Thread (8 messages) 8 messages, 5 authors, 2021-09-29

Re: [PATCH v5 06/11] ssb: Simplify determination of driver name

From: Michael Büsch <m@bues.ch>
Date: 2021-09-29 11:58:45
Also in: linux-pci

On Wed, 29 Sep 2021 10:53:01 +0200
Uwe Kleine-König [off-list ref] wrote:
For all drivers that make use of ssb_pcihost_probe() (i.e.
b43_pci_bridge_driver and b44_pci_driver) the driver name is set.
As at the time for the function is called __pci_register_driver() already
assigned drv->driver.name to hold the same value, use
dev_driver_string() with the same result.

This has the upside of not requiring the driver member of struct pci_dev
which is about to be removed and being simpler.
quoted hunk ↗ jump to hunk
 	struct ssb_bus *ssb;
 	int err = -ENOMEM;
-	const char *name;
 	u32 val;
 
 	ssb = kzalloc(sizeof(*ssb), GFP_KERNEL);
@@ -78,10 +77,7 @@ static int ssb_pcihost_probe(struct pci_dev *dev,
 	err = pci_enable_device(dev);
 	if (err)
 		goto err_kfree_ssb;
-	name = dev_name(&dev->dev);
-	if (dev->driver && dev->driver->name)
-		name = dev->driver->name;
-	err = pci_request_regions(dev, name);
+	err = pci_request_regions(dev, dev_driver_string(&dev->dev));
 	if (err)
 		goto err_pci_disable;
 	pci_set_master(dev);
Makes sense.

Acked-by: Michael Büsch <m@bues.ch>


-- 
Michael

https://bues.ch/

Attachments

  • (unnamed) [application/pgp-signature] 833 bytes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help