* [PATCH] ehca: remove driver_data direct access of struct device
@ 2009-05-11 20:25 Roel Kluin
2009-05-12 12:40 ` Hoang-Nam Nguyen
0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-05-11 20:25 UTC (permalink / raw)
To: hnguyen; +Cc: general, lkml
To avoid direct access to the driver_data pointer in struct device, the
functions dev_get_drvdata() and dev_set_drvdata() should be used.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index 368311c..5acfb4c 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -749,7 +749,7 @@ static int __devinit ehca_probe(struct of_device *dev,
shca->ofdev = dev;
shca->ipz_hca_handle.handle = *handle;
- dev->dev.driver_data = shca;
+ dev_set_drvdata(&dev->dev, shca);
ret = ehca_sense_attributes(shca);
if (ret < 0) {
@@ -878,7 +878,7 @@ probe1:
static int __devexit ehca_remove(struct of_device *dev)
{
- struct ehca_shca *shca = dev->dev.driver_data;
+ struct ehca_shca *shca = dev_get_drvdata(&dev->dev);
unsigned long flags;
int ret;
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ehca: remove driver_data direct access of struct device
2009-05-11 20:25 [PATCH] ehca: remove driver_data direct access of struct device Roel Kluin
@ 2009-05-12 12:40 ` Hoang-Nam Nguyen
0 siblings, 0 replies; 2+ messages in thread
From: Hoang-Nam Nguyen @ 2009-05-12 12:40 UTC (permalink / raw)
To: Roel Kluin; +Cc: general, lkml, Greg KH
Hi,
Thanks for this patch. But I've to NACK because
1) Greg KH has already done a similar patch in his tree.
See http://lists.openfabrics.org/pipermail/general/2009-May/059442.html
2) Your patch is incomplete
Regards
Nam
Roel Kluin <roel.kluin@gmail.com> wrote on 11.05.2009 22:25:07:
> From:
>
> Roel Kluin <roel.kluin@gmail.com>
>
> To:
>
> Hoang-Nam Nguyen/Germany/IBM@IBMDE
>
> Cc:
>
> general@lists.openfabrics.org, lkml <linux-kernel@vger.kernel.org>:
>
> Date:
>
> 11.05.2009 22:25
>
> Subject:
>
> [PATCH] ehca: remove driver_data direct access of struct device
>
> To avoid direct access to the driver_data pointer in struct device, the
> functions dev_get_drvdata() and dev_set_drvdata() should be used.
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/
> infiniband/hw/ehca/ehca_main.c
> index 368311c..5acfb4c 100644
> --- a/drivers/infiniband/hw/ehca/ehca_main.c
> +++ b/drivers/infiniband/hw/ehca/ehca_main.c
> @@ -749,7 +749,7 @@ static int __devinit ehca_probe(struct of_device
*dev,
>
> shca->ofdev = dev;
> shca->ipz_hca_handle.handle = *handle;
> - dev->dev.driver_data = shca;
> + dev_set_drvdata(&dev->dev, shca);
>
> ret = ehca_sense_attributes(shca);
> if (ret < 0) {
> @@ -878,7 +878,7 @@ probe1:
>
> static int __devexit ehca_remove(struct of_device *dev)
> {
> - struct ehca_shca *shca = dev->dev.driver_data;
> + struct ehca_shca *shca = dev_get_drvdata(&dev->dev);
> unsigned long flags;
> int ret;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-12 12:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-11 20:25 [PATCH] ehca: remove driver_data direct access of struct device Roel Kluin
2009-05-12 12:40 ` Hoang-Nam Nguyen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox