From: Samuel Ortiz <sameo@linux.intel.com>
To: Mattias Wallin <mattias.wallin@stericsson.com>
Cc: linux-kernel@vger.kernel.org,
Linus Walleij <linus.walleij@stericsson.com>
Subject: Re: [PATCH] MFD: ab8500-core improved error handling in get_chip_id
Date: Thu, 9 Dec 2010 13:16:05 +0100 [thread overview]
Message-ID: <20101209121604.GF8884@sortiz-mobl> (raw)
In-Reply-To: <1291298912-3589-1-git-send-email-mattias.wallin@stericsson.com>
Hi Mattias,
On Thu, Dec 02, 2010 at 03:08:32PM +0100, Mattias Wallin wrote:
> This patch improves the error handling in ab8500_get_chip_id.
Patch applied.
One general comment: Your title and changelog should be different. The former
should basically be a one liner explaining what you're doing, and the latter
should explain why and how you're doing so.
Cheers,
Samuel.
> Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>
> ---
> drivers/mfd/ab8500-core.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
> index d9640a6..e91b5b7 100644
> --- a/drivers/mfd/ab8500-core.c
> +++ b/drivers/mfd/ab8500-core.c
> @@ -103,8 +103,12 @@ static const int ab8500_irq_regoffset[AB8500_NUM_IRQ_REGS] = {
>
> static int ab8500_get_chip_id(struct device *dev)
> {
> - struct ab8500 *ab8500 = dev_get_drvdata(dev->parent);
> - return (int)ab8500->chip_id;
> + struct ab8500 *ab8500;
> +
> + if (!dev)
> + return -EINVAL;
> + ab8500 = dev_get_drvdata(dev->parent);
> + return ab8500 ? (int)ab8500->chip_id : -EINVAL;
> }
>
> static int set_register_interruptible(struct ab8500 *ab8500, u8 bank,
> --
> 1.7.2.2
>
--
Intel Open Source Technology Centre
http://oss.intel.com/
prev parent reply other threads:[~2010-12-09 12:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-02 14:08 [PATCH] MFD: ab8500-core improved error handling in get_chip_id Mattias Wallin
2010-12-09 12:16 ` Samuel Ortiz [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=20101209121604.GF8884@sortiz-mobl \
--to=sameo@linux.intel.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mattias.wallin@stericsson.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.