From: "eric miao" <eric.y.miao@gmail.com>
To: "Evgeniy Polyakov" <johnpol@2ka.mipt.ru>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, szabolcs.gyurko@tlt.hu
Subject: Re: [PATCH] make ds1wm driver to check ds1wm_platform_data pointer against NULL
Date: Sun, 11 Nov 2007 10:26:12 +0800 [thread overview]
Message-ID: <f17812d70711101826y24af0f6cg11a8850df20dd9eb@mail.gmail.com> (raw)
In-Reply-To: <20071110170831.GA15564@2ka.mipt.ru>
On Nov 11, 2007 1:08 AM, Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:
> On Fri, Nov 09, 2007 at 05:02:38PM -0800, Andrew Morton (akpm@linux-foundation.org) wrote:
> > > @@ -351,6 +351,10 @@ static int ds1wm_probe(struct platform_device *pdev)
> > > goto err0;
> > > }
> > > plat = pdev->dev.platform_data;
> > > + if (!plat) {
> > > + ret = -ENXIO;
> > > + goto err0;
> > > + }
> > > ds1wm_data->bus_shift = plat->bus_shift;
> > > ds1wm_data->pdev = pdev;
> > > ds1wm_data->pdata = plat;
> >
> > I don't understand this change. Could you please provide some more details
> > regarding what problem it is solving? How can pdev->dev.platform_data==NULL
> > come about?
>
> If I understood correctly, it is posible to call platform's probe
> callback without previously calling platform_device_add_data() to setup
> platform_data.
>
> But actually I failed to find any user of this platform driver in
> vanilla kernel, so it is hard to say if driver is used properly or not
> by external modules, and thus this change is very likely valid.
>
> --
> Evgeniy Polyakov
>
Yes, that's exactly what this patch meant to prevent. That no use of
this platform driver in vanilla kernel doesn't mean the check is
unnecessary. Actually, from the code of this driver, the platform_data
is mandatory for the driver to work properly. Well, if an oops is
on purpose when platform_data == NULL, this is, I agree, completely
unnecessary.
--
Cheers
- eric
prev parent reply other threads:[~2007-11-11 2:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-09 6:07 eric miao
2007-11-10 1:02 ` Andrew Morton
2007-11-10 17:08 ` Evgeniy Polyakov
2007-11-11 2:26 ` eric miao [this message]
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=f17812d70711101826y24af0f6cg11a8850df20dd9eb@mail.gmail.com \
--to=eric.y.miao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=johnpol@2ka.mipt.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=szabolcs.gyurko@tlt.hu \
/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®