Skip to content

Commit

Permalink
infiniband: ehca: remove driver_data direct access of struct device
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Greg Kroah-Hartman committed Jun 16, 2009
1 parent 559fde7 commit f899c2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/infiniband/hw/ehca/ehca_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ static ssize_t ehca_show_##name(struct device *dev, \
struct hipz_query_hca *rblock; \
int data; \
\
shca = dev->driver_data; \
shca = dev_get_drvdata(dev); \
\
rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL); \
if (!rblock) { \
Expand Down Expand Up @@ -680,7 +680,7 @@ static ssize_t ehca_show_adapter_handle(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct ehca_shca *shca = dev->driver_data;
struct ehca_shca *shca = dev_get_drvdata(dev);

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

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -878,7 +878,7 @@ static int __devinit ehca_probe(struct of_device *dev,

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;

Expand Down

0 comments on commit f899c2d

Please sign in to comment.