linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: linux-i2c@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>,
	Neil Horman <nhorman@tuxdriver.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH 1/6] i2c: ismt: improve usage of devres API
Date: Mon, 28 Sep 2015 13:45:32 +0300	[thread overview]
Message-ID: <1443437132.8361.237.camel@linux.intel.com> (raw)
In-Reply-To: <1442413443-123579-1-git-send-email-andriy.shevchenko@linux.intel.com>

On Wed, 2015-09-16 at 17:23 +0300, Andy Shevchenko wrote:
> pcim_release() will release any requested region. There is no need to 
> duplicate
> this effort in the driver.

Any comments on that clean up series?

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/i2c/busses/i2c-ismt.c | 18 +++++-------------
>  1 file changed, 5 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c
> -ismt.c
> index f994712..b7a68b5 100644
> --- a/drivers/i2c/busses/i2c-ismt.c
> +++ b/drivers/i2c/busses/i2c-ismt.c
> @@ -904,8 +904,7 @@ ismt_probe(struct pci_dev *pdev, const struct 
> pci_device_id *id)
>  	priv->smba = pcim_iomap(pdev, SMBBAR, len);
>  	if (!priv->smba) {
>  		dev_err(&pdev->dev, "Unable to ioremap SMBus 
> BAR\n");
> -		err = -ENODEV;
> -		goto fail;
> +		return -ENODEV;
>  	}
>  
>  	if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0) ||
> @@ -915,32 +914,26 @@ ismt_probe(struct pci_dev *pdev, const struct 
> pci_device_id *id)
>  						 DMA_BIT_MASK(32)) 
> != 0)) {
>  			dev_err(&pdev->dev, "pci_set_dma_mask fail 
> %p\n",
>  				pdev);
> -			err = -ENODEV;
> -			goto fail;
> +			return -ENODEV;
>  		}
>  	}
>  
>  	err = ismt_dev_init(priv);
>  	if (err)
> -		goto fail;
> +		return err;
>  
>  	ismt_hw_init(priv);
>  
>  	err = ismt_int_init(priv);
>  	if (err)
> -		goto fail;
> +		return err;
>  
>  	err = i2c_add_adapter(&priv->adapter);
>  	if (err) {
>  		dev_err(&pdev->dev, "Failed to add SMBus iSMT 
> adapter\n");
> -		err = -ENODEV;
> -		goto fail;
> +		return -ENODEV;
>  	}
>  	return 0;
> -
> -fail:
> -	pci_release_region(pdev, SMBBAR);
> -	return err;
>  }
>  
>  /**
> @@ -952,7 +945,6 @@ static void ismt_remove(struct pci_dev *pdev)
>  	struct ismt_priv *priv = pci_get_drvdata(pdev);
>  
>  	i2c_del_adapter(&priv->adapter);
> -	pci_release_region(pdev, SMBBAR);
>  }
>  
>  /**

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

  parent reply	other threads:[~2015-09-28 10:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16 14:23 [PATCH 1/6] i2c: ismt: improve usage of devres API Andy Shevchenko
     [not found] ` <1442413443-123579-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-09-16 14:23   ` [PATCH 2/6] i2c: ismt: PCI core handles power state for us Andy Shevchenko
2015-10-20 14:42     ` Wolfram Sang
2015-09-16 14:24   ` [PATCH 3/6] i2c: ismt: do not duplicate msi_enabled flag Andy Shevchenko
2015-09-16 14:24   ` [PATCH 4/6] i2c: ismt: propagate actual error code Andy Shevchenko
2015-09-16 14:24   ` [PATCH 5/6] i2c: ismt: issue a warning when fail to request MSI Andy Shevchenko
2015-09-16 14:24   ` [PATCH 6/6] i2c: ismt: mark register space with __iomem Andy Shevchenko
2015-09-28 10:45 ` Andy Shevchenko [this message]
2015-09-28 11:01   ` [PATCH 1/6] i2c: ismt: improve usage of devres API Mika Westerberg
2015-10-20 14:47     ` 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=1443437132.8361.237.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=nhorman@tuxdriver.com \
    --cc=wsa@the-dreams.de \
    /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).