From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org,
Shawn Guo <shawn.guo@linaro.org>,
Thierry Reding <thierry.reding@gmail.com>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>, Rob Landley <rob@landley.net>,
linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] PWM: let of_xlate handlers check args count
Date: Thu, 23 Jan 2014 11:56:32 +0100 [thread overview]
Message-ID: <20140123115632.6d3f1a58@ipc1.ka-ro> (raw)
In-Reply-To: <1390467898-9216-2-git-send-email-s.hauer@pengutronix.de>
Hi,
Sascha Hauer wrote:
> of_pwm_n_cells for the of_xlate handler is stored in struct pwm_chip,
> but it is only ever used by the of_xlate handler itsel. Remove
> of_pwm_n_cells from struct pwm_chip and let the handler do the argument
> count checking to simplify the code.
>
This still does not make the PWM_POLARITY flag in the pwms node
optional as was the goal because of_parse_phandle_with_args() requires
at least #pwm-cells arguments in the node.
So, with a DT configuration like:
pwm0: pwm@0 {
#pwm-cells = <3>;
};
backlight {
pwms = <&pwm0 0 100000>;
};
the driver will bail out at of_parse_phandle_with_args() in
of_pwm_get() with the error message:
"/backlight: arguments longer than property" and never reach your
clever xlate function.
Thus you will still need to replace of_parse_phandle_with_args()
with different code that copies most but not all of the functionality.
Lothar Waßmann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________
next prev parent reply other threads:[~2014-01-23 10:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-16 8:06 [PATCHv2 0/2] pwm: imx: support polarity inversion Lothar Waßmann
2014-01-16 8:06 ` [PATCHv2 1/2] pwm: imx: indentation cleanup Lothar Waßmann
2014-01-16 8:06 ` [PATCHv2 2/2] pwm: imx: support polarity inversion Lothar Waßmann
2014-01-16 16:03 ` Sascha Hauer
2014-01-23 7:37 ` Lothar Waßmann
2014-01-23 9:04 ` Sascha Hauer
2014-01-23 9:04 ` [PATCH 1/2] PWM: let of_xlate handlers check args count Sascha Hauer
2014-01-23 10:56 ` Lothar Waßmann [this message]
2014-01-23 11:04 ` Sascha Hauer
2014-01-23 16:53 ` Russell King - ARM Linux
2014-01-23 17:36 ` Russell King - ARM Linux
2014-01-24 5:42 ` Lothar Waßmann
2014-01-24 7:41 ` Sascha Hauer
2014-01-23 9:04 ` [PATCH 2/2] PWM: handle additional flags in of_pwm_simple_xlate Sascha Hauer
2014-01-23 11:52 ` [PATCHv2 2/2] pwm: imx: support polarity inversion Russell King - ARM Linux
2014-01-23 12:33 ` Russell King - ARM Linux
2014-01-23 16:44 ` Russell King - ARM Linux
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=20140123115632.6d3f1a58@ipc1.ka-ro \
--to=lw@karo-electronics.de \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=rob@landley.net \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawn.guo@linaro.org \
--cc=thierry.reding@gmail.com \
/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
all inboxes | Powered by JetHome®