[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A08B9AD.3030208@s5r6.in-berlin.de>
Date: Tue, 12 May 2009 01:50:05 +0200
From: Stefan Richter <stefanr@...6.in-berlin.de>
To: Roel Kluin <roel.kluin@...il.com>,
Greg Kroah-Hartman <gregkh@...e.de>
CC: krh@...hat.com, linux1394-devel@...ts.sourceforge.net,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] firewire: remove driver_data direct access of struct
device
Roel Kluin wrote:
> 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@...il.com>
Greg has this already in his driver core tree.
BTW Greg, just in case, the patches
"firewire: remove driver_data direct access of struct device" and
"ieee1394: remove driver_data direct access of struct device"
which you posted on April 30 are
Acked-by: Stefan Richter <stefanr@...6.in-berlin.de>
> ---
> diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
> index 2bcf515..a70e66e 100644
> --- a/drivers/firewire/fw-sbp2.c
> +++ b/drivers/firewire/fw-sbp2.c
> @@ -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);
> @@ -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;
> @@ -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));
--
Stefan Richter
-=====-=-=== -=-= -==-=
http://arcgraph.de/sr/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists