From: Peter Korsgaard <jacmet@sunsite.dk>
To: Daniel Mack <zonque@gmail.com>
Cc: dwmw2@infradead.org, linux-mtd@lists.infradead.org,
Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Subject: Re: [PATCH] mtd: devices: elm: check for device's presence before configuration
Date: Sun, 03 Mar 2013 22:44:05 +0100 [thread overview]
Message-ID: <87k3pow44a.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <1362345178-12536-1-git-send-email-zonque@gmail.com> (Daniel Mack's message of "Sun, 3 Mar 2013 22:12:58 +0100")
>>>>> "Daniel" == Daniel Mack <zonque@gmail.com> writes:
Daniel> In case the driver is not probed - due to config mismatches or errors
Daniel> in the DTS files - dev_get_drvdata() returns NULL, leading to an Ooops
Daniel> during boot. Better bail out with a warning in such cases.
Daniel> Signed-off-by: Daniel Mack <zonque@gmail.com>
Daniel> Cc: Philip Avinash <avinashphilip@ti.com>
Daniel> Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Daniel> ---
Daniel> drivers/mtd/devices/elm.c | 5 +++++
Daniel> 1 file changed, 5 insertions(+)
Daniel> diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c
Daniel> index 2ec5da9..a9b6d04 100644
Daniel> --- a/drivers/mtd/devices/elm.c
Daniel> +++ b/drivers/mtd/devices/elm.c
Daniel> @@ -86,6 +86,11 @@ void elm_config(struct device *dev, enum bch_ecc bch_type)
Daniel> u32 reg_val;
Daniel> struct elm_info *info = dev_get_drvdata(dev);
Daniel> + if (!info) {
Daniel> + dev_err(dev, "Unable to configure elm - device not probed?\n");
Daniel> + return;
Daniel> + }
Daniel> +
Even better would be to propagate the error message (E.G. return
-ENODEV) and let omap2.c deal with it (fall back to sw).
--
Bye, Peter Korsgaard
next prev parent reply other threads:[~2013-03-03 21:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-03 21:12 [PATCH] mtd: devices: elm: check for device's presence before configuration Daniel Mack
2013-03-03 21:44 ` Peter Korsgaard [this message]
2013-03-03 22:03 ` Daniel Mack
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=87k3pow44a.fsf@dell.be.48ers.dk \
--to=jacmet@sunsite.dk \
--cc=artem.bityutskiy@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=zonque@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