[<prev] [next>] [day] [month] [year] [list]
Message-id: <002d01ce57a1$3b0fb780$b12f2680$@samsung.com>
Date: Thu, 23 May 2013 19:35:23 +0900
From: Jingoo Han <jg1.han@...sung.com>
To: 'Greg Kroah-Hartman' <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, 'Jingoo Han' <jg1.han@...sung.com>
Subject: [PATCH] misc: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.
Signed-off-by: Jingoo Han <jg1.han@...sung.com>
---
drivers/misc/carma/carma-fpga-program.c | 4 ++--
drivers/misc/carma/carma-fpga.c | 4 ++--
drivers/misc/spear13xx_pcie_gadget.c | 4 ++--
drivers/misc/ti-st/st_kim.c | 6 +++---
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/misc/carma/carma-fpga-program.c b/drivers/misc/carma/carma-fpga-program.c
index 736c771..fa017cf 100644
--- a/drivers/misc/carma/carma-fpga-program.c
+++ b/drivers/misc/carma/carma-fpga-program.c
@@ -919,7 +919,7 @@ static bool dma_filter(struct dma_chan *chan, void *data)
static int fpga_of_remove(struct platform_device *op)
{
- struct fpga_dev *priv = dev_get_drvdata(&op->dev);
+ struct fpga_dev *priv = platform_get_drvdata(op);
struct device *this_device = priv->miscdev.this_device;
sysfs_remove_group(&this_device->kobj, &fpga_attr_group);
@@ -969,7 +969,7 @@ static int fpga_of_probe(struct platform_device *op)
kref_init(&priv->ref);
- dev_set_drvdata(&op->dev, priv);
+ platform_set_drvdata(op, priv);
priv->dev = &op->dev;
mutex_init(&priv->lock);
init_completion(&priv->completion);
diff --git a/drivers/misc/carma/carma-fpga.c b/drivers/misc/carma/carma-fpga.c
index 7508caf..a2128af 100644
--- a/drivers/misc/carma/carma-fpga.c
+++ b/drivers/misc/carma/carma-fpga.c
@@ -1296,7 +1296,7 @@ static int data_of_probe(struct platform_device *op)
goto out_return;
}
- dev_set_drvdata(&op->dev, priv);
+ platform_set_drvdata(op, priv);
priv->dev = &op->dev;
kref_init(&priv->ref);
mutex_init(&priv->mutex);
@@ -1400,7 +1400,7 @@ out_return:
static int data_of_remove(struct platform_device *op)
{
- struct fpga_device *priv = dev_get_drvdata(&op->dev);
+ struct fpga_device *priv = platform_get_drvdata(op);
struct device *this_device = priv->miscdev.this_device;
/* remove all sysfs files, now the device cannot be re-enabled */
diff --git a/drivers/misc/spear13xx_pcie_gadget.c b/drivers/misc/spear13xx_pcie_gadget.c
index 7deb25d..84a8dab 100644
--- a/drivers/misc/spear13xx_pcie_gadget.c
+++ b/drivers/misc/spear13xx_pcie_gadget.c
@@ -776,7 +776,7 @@ static int spear_pcie_gadget_probe(struct platform_device *pdev)
goto err_iounmap_app;
}
- dev_set_drvdata(&pdev->dev, target);
+ platform_set_drvdata(pdev, target);
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
@@ -863,7 +863,7 @@ static int spear_pcie_gadget_remove(struct platform_device *pdev)
res0 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
res1 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
irq = platform_get_irq(pdev, 0);
- target = dev_get_drvdata(&pdev->dev);
+ target = platform_get_drvdata(pdev);
config = &target->config;
free_irq(irq, NULL);
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index 83269f1..83907c7 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -680,7 +680,7 @@ void st_kim_ref(struct st_data_s **core_data, int id)
*core_data = NULL;
return;
}
- kim_gdata = dev_get_drvdata(&pdev->dev);
+ kim_gdata = platform_get_drvdata(pdev);
*core_data = kim_gdata->core_data;
}
@@ -735,7 +735,7 @@ static int kim_probe(struct platform_device *pdev)
pr_err("no mem to allocate");
return -ENOMEM;
}
- dev_set_drvdata(&pdev->dev, kim_gdata);
+ platform_set_drvdata(pdev, kim_gdata);
err = st_core_init(&kim_gdata->core_data);
if (err != 0) {
@@ -810,7 +810,7 @@ static int kim_remove(struct platform_device *pdev)
struct ti_st_plat_data *pdata = pdev->dev.platform_data;
struct kim_data_s *kim_gdata;
- kim_gdata = dev_get_drvdata(&pdev->dev);
+ kim_gdata = platform_get_drvdata(pdev);
/* Free the Bluetooth/FM/GPIO
* nShutdown gpio from the system
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists