linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Haavard Skinnemoen <hskinnemoen@gmail.com>,
	Bryan Wu <cooloney@gmail.com>, Richard Purdie <rpurdie@rpsys.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jingoo Han <jg1.han@samsung.com>,
	linux-leds@vger.kernel.org, linux-pwm@vger.kernel.org,
	linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 09/16] avr32/at32ap: switch to the generic PWM framework
Date: Mon, 7 Apr 2014 13:28:23 +0200	[thread overview]
Message-ID: <20140407112821.GC26985@ulmo> (raw)
In-Reply-To: <20140319141820.GA20872@samfundet.no>

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

On Wed, Mar 19, 2014 at 03:18:20PM +0100, Hans-Christian Egtvedt wrote:
> Around Wed 19 Mar 2014 14:03:22 +0100 or thereabout, Alexandre Belloni wrote:
> > Switch to the pwm/pwm-atmel driver instead of misc/atmel_pwm
> > 
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> 
> Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> 
> > ---
> >  arch/avr32/mach-at32ap/at32ap700x.c | 7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> > index a1f4d1e91b52..db85b5ec3351 100644
> > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > @@ -1553,7 +1553,7 @@ static struct resource atmel_pwm0_resource[] __initdata = {
> >  	IRQ(24),
> >  };
> >  static struct clk atmel_pwm0_mck = {
> > -	.name		= "pwm_clk",
> > +	.name		= "at91sam9rl-pwm",
> 
> I found this a tiny bit weird, but found the matching instance in
> drivers/pwm/pwm-atmel.c
> 
> IMHO it would initially have been better to call it atpwm_v1 or something
> similar, more generic. But I guess that is too late to change at this point.

Generally when you call clk_get(dev, NULL), you'll pass in the consumer
device as "dev". Now the avr32 clock implementation compares that to the
device associated with the clock, which for the case of the PWM pwm0_mck
is the PWM controller (at32_add_device_pwm() for reference). So it seems
to be set up properly (the PWM controller is the consumer).

Also since the consumer ID isn't specified to the clk_get() call, the
name of the clock (what's being changed in the above hunk) shouldn't
matter because it won't match anyway.

Now that I look at it more closely, I wonder how clk_get(dev, NULL) can
even work on avr32, since there's no check for id == NULL and therefore
NULL will be blindly passed into strcmp() and then crash.

Thierry

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

  reply	other threads:[~2014-04-07 11:28 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-19 13:03 [PATCH 00/16] move at91 and avr32 to the PWM framework, remove obsolete drivers Alexandre Belloni
2014-03-19 13:03 ` [PATCH 01/16] ARM: at91: at91sam9g45: switch to generic PWM framework Alexandre Belloni
2014-03-19 13:03 ` [PATCH 02/16] ARM: at91: sam9m10g45ek: use generic leds_pwm driver Alexandre Belloni
2014-03-19 13:03 ` [PATCH 03/16] ARM: at91: at91sam9263: switch to generic PWM framework Alexandre Belloni
2014-03-19 13:03 ` [PATCH 04/16] ARM: at91: sam9263ek: use generic leds_pwm driver Alexandre Belloni
2014-03-19 13:03 ` [PATCH 05/16] ARM: at91: at91sam9rl: switch to generic PWM framework Alexandre Belloni
2014-03-19 13:03 ` [PATCH 06/16] ARM: at91: remove useless at91_pwm_leds() Alexandre Belloni
2014-03-19 13:03 ` [PATCH 07/16] PWM: atmel: allow building for AVR32 Alexandre Belloni
2014-03-19 13:03 ` [PATCH 08/16] backlight: pwm_bl: set pwm polarity when using platform data Alexandre Belloni
2014-04-07 11:16   ` Thierry Reding
2014-03-19 13:03 ` [PATCH 09/16] avr32/at32ap: switch to the generic PWM framework Alexandre Belloni
2014-03-19 14:18   ` Hans-Christian Egtvedt
2014-04-07 11:28     ` Thierry Reding [this message]
2014-03-19 13:03 ` [PATCH 10/16] avr32: MRMT: use generic leds_pwm driver Alexandre Belloni
2014-03-19 14:19   ` Hans-Christian Egtvedt
2014-03-19 13:03 ` [PATCH 11/16] avr32: merisc: " Alexandre Belloni
2014-03-19 14:20   ` Hans-Christian Egtvedt
2014-03-19 13:03 ` [PATCH 12/16] avr32: favr-32: use generic pwm_bl driver Alexandre Belloni
2014-03-19 14:20   ` Hans-Christian Egtvedt
2014-03-19 13:03 ` [PATCH 13/16] avr32: update defconfig to use the generic PWM framework Alexandre Belloni
2014-03-19 14:21   ` Hans-Christian Egtvedt
2014-03-19 13:03 ` [PATCH 14/16] backlight: atmel-pwm-bl: remove obsolete driver Alexandre Belloni
2014-03-19 14:22   ` Hans-Christian Egtvedt
2014-03-21  0:51     ` Jingoo Han
2014-03-24 15:54       ` Alexandre Belloni
2014-03-25  0:15         ` Jingoo Han
2014-03-19 13:03 ` [PATCH 15/16] leds: atmel-pwm: " Alexandre Belloni
2014-03-27 17:27   ` Bryan Wu
2014-03-19 13:03 ` [PATCH 16/16] misc: atmel_pwm: " Alexandre Belloni
2014-03-27 17:43 ` [PATCH 00/16] move at91 and avr32 to the PWM framework, remove obsolete drivers Nicolas Ferre
2014-03-27 18:21   ` Alexandre Belloni

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=20140407112821.GC26985@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=cooloney@gmail.com \
    --cc=egtvedt@samfundet.no \
    --cc=gregkh@linuxfoundation.org \
    --cc=hskinnemoen@gmail.com \
    --cc=jg1.han@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=rpurdie@rpsys.net \
    /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).