2019-07-24 15:49:03

by Chuhong Yuan

[permalink] [raw]
Subject: [PATCH] pcmcia: Use dev_get_drvdata where possible

Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.

Signed-off-by: Chuhong Yuan <[email protected]>
---
drivers/pcmcia/yenta_socket.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 810761ab8e9d..49b1c6a1bdbe 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -173,8 +173,7 @@ static void exca_writew(struct yenta_socket *socket, unsigned reg, u16 val)

static ssize_t show_yenta_registers(struct device *yentadev, struct device_attribute *attr, char *buf)
{
- struct pci_dev *dev = to_pci_dev(yentadev);
- struct yenta_socket *socket = pci_get_drvdata(dev);
+ struct yenta_socket *socket = dev_get_drvdata(yentadev);
int offset = 0, i;

offset = snprintf(buf, PAGE_SIZE, "CB registers:");
--
2.20.1


2019-11-21 10:07:40

by Dominik Brodowski

[permalink] [raw]
Subject: Re: [PATCH] pcmcia: Use dev_get_drvdata where possible

On Wed, Jul 24, 2019 at 08:23:08PM +0800, Chuhong Yuan wrote:
> Instead of using to_pci_dev + pci_get_drvdata,
> use dev_get_drvdata to make code simpler.

Applied to the pcmcia tree.

Thanks,
Dominik