All of lore.kernel.org
 help / color / mirror / Atom feed
From: mpa@pengutronix.de (Markus Pargmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/2] regulator: core: Replace direct ops->disable usage
Date: Thu, 20 Feb 2014 14:01:08 +0100	[thread overview]
Message-ID: <20140220130108.GD21048@pengutronix.de> (raw)
In-Reply-To: <20140220125130.GQ2669@sirena.org.uk>

On Thu, Feb 20, 2014 at 09:51:30PM +0900, Mark Brown wrote:
> On Thu, Feb 20, 2014 at 12:07:52PM +0100, Markus Pargmann wrote:
> 
> > --- a/drivers/regulator/core.c
> > +++ b/drivers/regulator/core.c
> > @@ -1908,8 +1908,6 @@ static int _regulator_do_disable(struct regulator_dev *rdev)
> >  
> >  	trace_regulator_disable_complete(rdev_get_name(rdev));
> >  
> > -	_notifier_call_chain(rdev, REGULATOR_EVENT_DISABLE,
> > -			     NULL);
> >  	return 0;
> >  }
> >  
> > @@ -1933,6 +1931,8 @@ static int _regulator_disable(struct regulator_dev *rdev)
> >  				rdev_err(rdev, "failed to disable\n");
> >  				return ret;
> >  			}
> > +			_notifier_call_chain(rdev, REGULATOR_EVENT_DISABLE,
> > +					NULL);
> >  		}
> >  
> >  		rdev->use_count = 0;
> 
> This change doesn't seem obviously related?

I am using this function from _regulator_force_disable(), which calls
_notifier_call_chain() with one additional flag
"REGULATOR_EVENT_FORCE_DISABLE". To prevent calling
_notifier_call_chain() twice for the force_disable case, I moved that
function call out of _regulator_do_disable().

Regards,

Markus

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140220/e35c4719/attachment.sig>

WARNING: multiple messages have this Message-ID (diff)
From: Markus Pargmann <mpa@pengutronix.de>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 2/2] regulator: core: Replace direct ops->disable usage
Date: Thu, 20 Feb 2014 14:01:08 +0100	[thread overview]
Message-ID: <20140220130108.GD21048@pengutronix.de> (raw)
In-Reply-To: <20140220125130.GQ2669@sirena.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1450 bytes --]

On Thu, Feb 20, 2014 at 09:51:30PM +0900, Mark Brown wrote:
> On Thu, Feb 20, 2014 at 12:07:52PM +0100, Markus Pargmann wrote:
> 
> > --- a/drivers/regulator/core.c
> > +++ b/drivers/regulator/core.c
> > @@ -1908,8 +1908,6 @@ static int _regulator_do_disable(struct regulator_dev *rdev)
> >  
> >  	trace_regulator_disable_complete(rdev_get_name(rdev));
> >  
> > -	_notifier_call_chain(rdev, REGULATOR_EVENT_DISABLE,
> > -			     NULL);
> >  	return 0;
> >  }
> >  
> > @@ -1933,6 +1931,8 @@ static int _regulator_disable(struct regulator_dev *rdev)
> >  				rdev_err(rdev, "failed to disable\n");
> >  				return ret;
> >  			}
> > +			_notifier_call_chain(rdev, REGULATOR_EVENT_DISABLE,
> > +					NULL);
> >  		}
> >  
> >  		rdev->use_count = 0;
> 
> This change doesn't seem obviously related?

I am using this function from _regulator_force_disable(), which calls
_notifier_call_chain() with one additional flag
"REGULATOR_EVENT_FORCE_DISABLE". To prevent calling
_notifier_call_chain() twice for the force_disable case, I moved that
function call out of _regulator_do_disable().

Regards,

Markus

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-02-20 13:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20 11:07 [PATCH v2 0/2] regulator: core: Fix ops->enable/disable usage Markus Pargmann
2014-02-20 11:07 ` Markus Pargmann
2014-02-20 11:07 ` [PATCH v2 1/2] regulator: core: Replace direct ops->enable usage Markus Pargmann
2014-02-20 11:07   ` Markus Pargmann
2014-02-20 11:07 ` [PATCH v2 2/2] regulator: core: Replace direct ops->disable usage Markus Pargmann
2014-02-20 11:07   ` Markus Pargmann
2014-02-20 12:03   ` Markus Pargmann
2014-02-20 12:03     ` Markus Pargmann
2014-02-20 12:51   ` Mark Brown
2014-02-20 12:51     ` Mark Brown
2014-02-20 13:01     ` Markus Pargmann [this message]
2014-02-20 13:01       ` Markus Pargmann
2014-02-20 13:17       ` Mark Brown
2014-02-20 13:17         ` Mark Brown

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=20140220130108.GD21048@pengutronix.de \
    --to=mpa@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 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.