linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
To: Jean-Francois Moine <moinejf-GANU6spQydw@public.gmane.org>
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
	Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
	"Mark A. Greer" <mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"Ben Dooks (embedded platforms)"
	<ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
	Sebastian Hesselbarth
	<sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH 3/9] I2C: mv64xxx: use devm_ioremap_resource()
Date: Fri, 17 May 2013 10:34:49 +0100	[thread overview]
Message-ID: <20130517093449.GA18614@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20130517112316.12a3ddc3@armhf>

On Fri, May 17, 2013 at 11:23:16AM +0200, Jean-Francois Moine wrote:
> On Thu, 16 May 2013 21:33:09 +0100
> Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org> wrote:
> 
> > Eliminate reg_base_p and reg_size, mv64xxx_i2c_unmap_regs() and an
> > unchecked ioremap() return from this driver by using the devm_*
> > API for requesting and ioremapping resources.
> > 
> > Signed-off-by: Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
> > ---
> >  drivers/i2c/busses/i2c-mv64xxx.c |   46 +++++---------------------------------
> >  1 files changed, 6 insertions(+), 40 deletions(-)
> > 
> > diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
> > index 0339cd8..19cc9bf 100644
> > --- a/drivers/i2c/busses/i2c-mv64xxx.c
> > +++ b/drivers/i2c/busses/i2c-mv64xxx.c
> 	[snip]
> > @@ -704,7 +671,6 @@ mv64xxx_i2c_remove(struct platform_device *dev)
> >  
> >  	rc = i2c_del_adapter(&drv_data->adapter);
> >  	free_irq(drv_data->irq, drv_data);
> > -	mv64xxx_i2c_unmap_regs(drv_data);
> >  #if defined(CONFIG_HAVE_CLK)
> >  	/* Not all platforms have a clk */
> >  	if (!IS_ERR(drv_data->clk)) {
> 
> The patch does not apply: it seems it lacks:

I should've mentioned that the patches are against v3.9, not v3.10-rc1.

> +	int rc;
> 
> -	i2c_del_adapter(&drv_data->adapter);
> +	rc = i2c_del_adapter(&drv_data->adapter);
> 
> -	return 0;
> +	return rc;
> 
> BTW, is this return code useful?

No it isn't.  Removals *can't* fail.  Once the remove function is called,
the device _will_ be unbound no matter what the return value of that
function is.  The module will also be unloaded (if that's why it's being
unbound) whether or not you return an error.

So, removals must always succeed.  Why their return type hasn't been void
from the start I've no idea - but that's a question for Patrick Mochel
who implemented the original driver model design.

  reply	other threads:[~2013-05-17  9:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 20:29 [PATCH 0/9] Fix Marvell mv63xxx I2C driver Russell King - ARM Linux
2013-05-16 20:30 ` [PATCH 1/9] I2C: mv64xxx: work around signals causing I2C transactions to be aborted Russell King
     [not found]   ` <E1Ud4pH-0004JQ-Jq-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2013-05-17  6:37     ` Jean-Francois Moine
2013-05-17  8:31       ` Russell King - ARM Linux
2013-05-17 12:17     ` Wolfram Sang
2013-05-17 17:06   ` Mark A. Greer
2013-05-16 20:32 ` [PATCH 2/9] I2C: mv64xxx: use return value from mv64xxx_i2c_map_regs() Russell King
2013-05-16 20:33 ` [PATCH 3/9] I2C: mv64xxx: use devm_ioremap_resource() Russell King
     [not found]   ` <E1Ud4rN-0004Jc-CL-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2013-05-17  9:23     ` Jean-Francois Moine
2013-05-17  9:34       ` Russell King - ARM Linux [this message]
2013-05-16 20:34 ` [PATCH 4/9] I2C: mv64xxx: use devm_clk_get() to avoid missing clk_put() Russell King
2013-05-16 20:35 ` [PATCH 5/9] I2C: mv64xxx: use devm_kzalloc() Russell King
2013-05-16 20:36 ` [PATCH 6/9] I2C: mv64xxx: fix error handling for request_irq() Russell King
2013-05-16 20:37 ` [PATCH 7/9] I2C: mv64xxx: remove I2C_M_NOSTART code Russell King
     [not found]   ` <E1Ud4vH-0004Jz-F6-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2013-05-22 19:05     ` Mark Brown
2013-05-16 20:38 ` [PATCH 8/9] I2C: mv64xxx: move mv64xxx_i2c_prepare_for_io() Russell King
2013-05-16 20:39 ` [PATCH 9/9] I2C: mv64xxx: fix race between FSM/interrupt and process context Russell King
     [not found]   ` <E1Ud4xE-0004KB-2T-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2013-05-17  9:51     ` Wolfram Sang
2013-05-17 10:00       ` Russell King - ARM Linux
     [not found]         ` <20130517100016.GB18614-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-05-17 12:15           ` Wolfram Sang
     [not found] ` <20130516202921.GW18614-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-06-05 21:48   ` [PATCH 0/9] Fix Marvell mv63xxx I2C driver Wolfram Sang

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=20130517093449.GA18614@n2100.arm.linux.org.uk \
    --to=linux-lfz/pmaqli7xmaaqvzeohq@public.gmane.org \
    --cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
    --cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org \
    --cc=moinejf-GANU6spQydw@public.gmane.org \
    --cc=sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).