Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753444AbaAWLFT (ORCPT ); Thu, 23 Jan 2014 06:05:19 -0500 Received: from metis.ext.pengutronix.de ([92.198.50.35]:59631 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752816AbaAWLFS (ORCPT ); Thu, 23 Jan 2014 06:05:18 -0500 Date: Thu, 23 Jan 2014 12:04:44 +0100 From: Sascha Hauer To: Lothar =?iso-8859-15?Q?Wa=DFmann?= Cc: linux-arm-kernel@lists.infradead.org, Shawn Guo , Thierry Reding , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Rob Landley , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] PWM: let of_xlate handlers check args count Message-ID: <20140123110444.GI16215@pengutronix.de> References: <20140123083714.3c6e86ae@ipc1.ka-ro> <1390467898-9216-1-git-send-email-s.hauer@pengutronix.de> <1390467898-9216-2-git-send-email-s.hauer@pengutronix.de> <20140123115632.6d3f1a58@ipc1.ka-ro> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20140123115632.6d3f1a58@ipc1.ka-ro> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 11:59:43 up 151 days, 20:30, 49 users, load average: 0.06, 0.07, 0.06 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:6f8:1178:2:5054:ff:fec0:8e10 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 23, 2014 at 11:56:32AM +0100, Lothar Wa?mann wrote: > 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>; > }; We misunderstood each other. My goal was to allow the driver to also work with old devicetrees which specify #pwm-cells = <2>, not to allow inconsistent devicetrees like the snippet above. Sascha -- 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 | -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/