Skip to content

Commit

Permalink
firewire: 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: linux1394-devel@lists.sourceforge.net
Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Kristian Hoegsberg <krh@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Jun 16, 2009
1 parent 4b9d0d3 commit d961450
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/firewire/fw-sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ static int sbp2_probe(struct device *dev)
return -ENOMEM;

tgt = (struct sbp2_target *)shost->hostdata;
unit->device.driver_data = tgt;
dev_set_drvdata(&unit->device, tgt);
tgt->unit = unit;
kref_init(&tgt->kref);
INIT_LIST_HEAD(&tgt->lu_list);
Expand Down Expand Up @@ -1180,7 +1180,7 @@ static int sbp2_probe(struct device *dev)
static int sbp2_remove(struct device *dev)
{
struct fw_unit *unit = fw_unit(dev);
struct sbp2_target *tgt = unit->device.driver_data;
struct sbp2_target *tgt = dev_get_drvdata(&unit->device);

sbp2_target_put(tgt);
return 0;
Expand Down Expand Up @@ -1240,7 +1240,7 @@ static void sbp2_reconnect(struct work_struct *work)

static void sbp2_update(struct fw_unit *unit)
{
struct sbp2_target *tgt = unit->device.driver_data;
struct sbp2_target *tgt = dev_get_drvdata(&unit->device);
struct sbp2_logical_unit *lu;

fw_device_enable_phys_dma(fw_device(unit->device.parent));
Expand Down

0 comments on commit d961450

Please sign in to comment.