Skip to contentSkip to conversation

ehca: remove driver_data direct access of struct device

PATCH In review Roel Kluin 2 participants 2 messages May 11, 2009 – May 12, 2009 InfiniBand

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 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.

---

drivers/infiniband/hw/ehca/ehca_main.c +2 -2
index 368311c..5acfb4c 100644
@@ -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;
 
#1 lore raw

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 <[email protected]> wrote on 11.05.2009 22:25:07:

drivers/infiniband/hw/ehca/ehca_main.c static int __devinit ehca_probe(struct of_device

Quoted 31 lines

From:

Roel Kluin <[email protected]>

To:

Hoang-Nam Nguyen/Germany/IBM@IBMDE

Cc:

[email protected], lkml <[email protected]>:

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.

---

drivers/ renamed from drivers/infiniband/hw/ehca/ehca_main.c +0 -0

infiniband/hw/ehca/ehca_main.c
index 368311c..5acfb4c 100644

drivers/infiniband/hw/ehca/ehca_main.c +0 -0
@@ -749,7 +749,7 @@ static int __devinit ehca_probe(struct of_device

*dev,

Quoted 17 lines
drivers/infiniband/hw/ehca/ehca_main.c +2 -2
    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;