lkml.org 
[lkml]   [2021]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 4/6] PCI: Provide wrapper to access a pci_dev's bound driver
    Date
    Which driver a device is bound to is available twice: In struct
    pci_dev::dev->driver and in struct pci_dev::driver. To get rid of the
    duplication introduce a wrapper to access struct pci_dev's driver
    member. Once all users are converted the wrapper can be changed to
    calculate the driver using pci_dev::dev->driver.

    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    ---
    include/linux/pci.h | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/include/linux/pci.h b/include/linux/pci.h
    index 540b377ca8f6..778f3b5e6f23 100644
    --- a/include/linux/pci.h
    +++ b/include/linux/pci.h
    @@ -887,6 +887,7 @@ struct pci_driver {
    };

    #define to_pci_driver(drv) container_of(drv, struct pci_driver, driver)
    +#define pci_driver_of_dev(pdev) ((pdev)->driver)

    /**
    * PCI_DEVICE - macro used to describe a specific PCI device
    --
    2.30.2
    \
     
     \ /
      Last update: 2021-08-03 12:04    [W:7.269 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site