Skip to content

Commit f899c2d

Browse files
committed
infiniband: ehca: remove driver_data direct access of struct device
In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: Sean Hefty <sean.hefty@intel.com> Cc: Roland Dreier <rolandd@cisco.com> Cc: Hal Rosenstock <hal.rosenstock@gmail.com> Cc: general@lists.openfabrics.org Cc: Christoph Raisch <raisch@de.ibm.com> Acked-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 559fde7 commit f899c2d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/infiniband/hw/ehca/ehca_main.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ static ssize_t ehca_show_##name(struct device *dev, \
636636
struct hipz_query_hca *rblock; \
637637
int data; \
638638
\
639-
shca = dev->driver_data; \
639+
shca = dev_get_drvdata(dev); \
640640
\
641641
rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL); \
642642
if (!rblock) { \
@@ -680,7 +680,7 @@ static ssize_t ehca_show_adapter_handle(struct device *dev,
680680
struct device_attribute *attr,
681681
char *buf)
682682
{
683-
struct ehca_shca *shca = dev->driver_data;
683+
struct ehca_shca *shca = dev_get_drvdata(dev);
684684

685685
return sprintf(buf, "%llx\n", shca->ipz_hca_handle.handle);
686686

@@ -749,7 +749,7 @@ static int __devinit ehca_probe(struct of_device *dev,
749749

750750
shca->ofdev = dev;
751751
shca->ipz_hca_handle.handle = *handle;
752-
dev->dev.driver_data = shca;
752+
dev_set_drvdata(&dev->dev, shca);
753753

754754
ret = ehca_sense_attributes(shca);
755755
if (ret < 0) {
@@ -878,7 +878,7 @@ static int __devinit ehca_probe(struct of_device *dev,
878878

879879
static int __devexit ehca_remove(struct of_device *dev)
880880
{
881-
struct ehca_shca *shca = dev->dev.driver_data;
881+
struct ehca_shca *shca = dev_get_drvdata(&dev->dev);
882882
unsigned long flags;
883883
int ret;
884884

0 commit comments

Comments
 (0)