linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mkl@pengutronix.de (Marc Kleine-Budde)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/3] can: mcp251x: Replace power callbacks with regulator API
Date: Tue, 20 Aug 2013 10:46:36 +0200	[thread overview]
Message-ID: <52132CEC.2030100@pengutronix.de> (raw)
In-Reply-To: <1376912361-22133-1-git-send-email-shc_work@mail.ru>

On 08/19/2013 01:39 PM, Alexander Shiyan wrote:
> This patch replaces power callbacks to the regulator API. To improve
> the readability of the code, helper for the regulator enable/disable
> was added.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  arch/arm/mach-pxa/icontrol.c         |  3 --
>  arch/arm/mach-pxa/zeus.c             | 46 ++++++++++----------
>  drivers/net/can/mcp251x.c            | 81 +++++++++++++++++++-----------------
>  include/linux/can/platform/mcp251x.h | 13 +-----
>  4 files changed, 69 insertions(+), 74 deletions(-)
> 
[...]

> diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
> index 8cda23b..3df83f8 100644
> --- a/drivers/net/can/mcp251x.c
> +++ b/drivers/net/can/mcp251x.c

[...]

> @@ -1163,15 +1170,14 @@ static int mcp251x_can_suspend(struct device *dev)
>  		netif_device_detach(net);
>  
>  		mcp251x_hw_sleep(spi);
> -		if (pdata->transceiver_enable)
> -			pdata->transceiver_enable(0);
> +		mcp251x_power_enable(priv->transceiver, 0);
>  		priv->after_suspend = AFTER_SUSPEND_UP;
>  	} else {
>  		priv->after_suspend = AFTER_SUSPEND_DOWN;
>  	}
>  
> -	if (pdata->power_enable) {
> -		pdata->power_enable(0);
> +	if (!IS_ERR(priv->power))
                                ^^^

There's a '{' missing.

> +		regulator_disable(priv->power);
>  		priv->after_suspend |= AFTER_SUSPEND_POWER;
>  	}
>  
> @@ -1185,12 +1191,11 @@ static int mcp251x_can_resume(struct device *dev)
>  	struct mcp251x_priv *priv = spi_get_drvdata(spi);
>  
>  	if (priv->after_suspend & AFTER_SUSPEND_POWER) {
> -		pdata->power_enable(1);
> +		mcp251x_power_enable(priv->power, 1);
>  		queue_work(priv->wq, &priv->restart_work);
>  	} else {
>  		if (priv->after_suspend & AFTER_SUSPEND_UP) {
> -			if (pdata->transceiver_enable)
> -				pdata->transceiver_enable(1);
> +			mcp251x_power_enable(priv->transceiver, 1);
>  			queue_work(priv->wq, &priv->restart_work);
>  		} else {
>  			priv->after_suspend = 0;

And I see the following warnings:

> /home/frogger/pengutronix/socketcan/linux/drivers/net/can/mcp251x.c: In function 'mcp251x_can_suspend':
> /home/frogger/pengutronix/socketcan/linux/drivers/net/can/mcp251x.c:1156:32: warning: unused variable 'pdata' [-Wunused-variable]
> /home/frogger/pengutronix/socketcan/linux/drivers/net/can/mcp251x.c: In function 'mcp251x_can_resume':
> /home/frogger/pengutronix/socketcan/linux/drivers/net/can/mcp251x.c:1187:32: warning: unused variable 'pdata' [-Wunused-variable]

I've fixed the problems and applied the patch to linux-can/testing.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130820/3579fa09/attachment.sig>

      parent reply	other threads:[~2013-08-20  8:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-19 11:39 [PATCH v2 1/3] can: mcp251x: Replace power callbacks with regulator API Alexander Shiyan
2013-08-19 11:39 ` [PATCH v2 2/3] can: mcp251x: Eliminate irq_flags from driver platform_data Alexander Shiyan
2013-08-20  8:58   ` Marc Kleine-Budde
2013-08-19 11:39 ` [PATCH v2 3/3] can: mcp251x: Allow tuning SPI mode and limit maximal SPI speed Alexander Shiyan
2013-08-20  8:59   ` Marc Kleine-Budde
2013-08-20  8:46 ` Marc Kleine-Budde [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=52132CEC.2030100@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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).