From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Roel Kluin <roel.kluin@gmail.com>, Greg Kroah-Hartman <gregkh@suse.de>
Cc: krh@redhat.com, linux1394-devel@lists.sourceforge.net,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] firewire: remove driver_data direct access of struct device
Date: Tue, 12 May 2009 01:50:05 +0200 [thread overview]
Message-ID: <4A08B9AD.3030208@s5r6.in-berlin.de> (raw)
In-Reply-To: <4A088827.7000907@gmail.com>
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@gmail.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@s5r6.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/
next prev parent reply other threads:[~2009-05-11 23:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-11 20:18 Roel Kluin
2009-05-11 23:50 ` Stefan Richter [this message]
2009-05-12 16:43 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A08B9AD.3030208@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=gregkh@suse.de \
--cc=krh@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=roel.kluin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®