From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan Mallon Subject: Re: [PATCH v3 06/10] pwm: Add NVIDIA Tegra SoC support Date: Thu, 23 Feb 2012 12:47:00 +1100 Message-ID: <4F459A94.4030104@gmail.com> References: <1329923841-32017-1-git-send-email-thierry.reding@avionic-design.de> <1329923841-32017-7-git-send-email-thierry.reding@avionic-design.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1329923841-32017-7-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Thierry Reding Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Sascha Hauer , Arnd Bergmann , Matthias Kaehlcke , Kurt Van Dijck , Rob Herring , Grant Likely , Colin Cross , Olof Johansson , Richard Purdie , Mark Brown , Mitch Bradley , Mike Frysinger , Eric Miao , Lars-Peter Clausen List-Id: devicetree@vger.kernel.org On 23/02/12 02:17, Thierry Reding wrote: > This commit adds a generic PWM framework driver for the PWFM controller > found on NVIDIA Tegra SoCs. The driver is based on code from the > Chromium kernel tree and was originally written by Gary King (NVIDIA) > and later modified by Simon Que (Chromium). > > Signed-off-by: Thierry Reding > --- > + > + pwm->chip.dev = &pdev->dev; > + pwm->chip.ops = &tegra_pwm_ops; > + pwm->chip.base = -1; > + pwm->chip.npwm = NUM_PWM; > + > + ret = pwmchip_add(&pwm->chip); If a driver fails to initialise the pwm_chip structure correctly it can cause problems in the pwm core. For example, if the dev field doesn't get set, then you will get an oops if you try to cat the pwm debugfs file. pwmchip_add should probably verify that the initialisation of the pwm_chip structure is sane to avoid problems like this. ~Ryan