From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87E6BC7618B for ; Mon, 29 Jul 2019 07:12:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 62CD920679 for ; Mon, 29 Jul 2019 07:12:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726780AbfG2HMa (ORCPT ); Mon, 29 Jul 2019 03:12:30 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:40575 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725957AbfG2HMa (ORCPT ); Mon, 29 Jul 2019 03:12:30 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hrzpU-0002Xc-0g; Mon, 29 Jul 2019 09:12:20 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1hrzpS-0004Zz-OL; Mon, 29 Jul 2019 09:12:18 +0200 Date: Mon, 29 Jul 2019 09:12:18 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Chen-Yu Tsai Cc: Jernej Skrabec , Thierry Reding , Maxime Ripard , Rob Herring , Mark Rutland , linux-pwm@vger.kernel.org, devicetree , linux-arm-kernel , linux-kernel , linux-sunxi , Philipp Zabel Subject: Re: [PATCH 2/6] pwm: sun4i: Add a quirk for reset line Message-ID: <20190729071218.bukw7vxilqy523k3@pengutronix.de> References: <20190726184045.14669-1-jernej.skrabec@siol.net> <20190726184045.14669-3-jernej.skrabec@siol.net> <20190729063630.rn325whatfnc3m7n@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, Jul 29, 2019 at 02:43:23PM +0800, Chen-Yu Tsai wrote: > On Mon, Jul 29, 2019 at 2:36 PM Uwe Kleine-König > wrote: > > On Fri, Jul 26, 2019 at 08:40:41PM +0200, Jernej Skrabec wrote: > > > @@ -371,6 +374,14 @@ static int sun4i_pwm_probe(struct platform_device *pdev) > > > if (IS_ERR(pwm->clk)) > > > return PTR_ERR(pwm->clk); > > > > > > + if (pwm->data->has_reset) { > > > + pwm->rst = devm_reset_control_get(&pdev->dev, NULL); > > > + if (IS_ERR(pwm->rst)) > > > + return PTR_ERR(pwm->rst); > > > + > > > + reset_control_deassert(pwm->rst); > > > + } > > > + > > > > I wonder why there is a need to track if a given chip needs a reset > > line. I'd just use devm_reset_control_get_optional() and drop the > > .has_reset member in struct sun4i_pwm_data. > > Because it's not optional for this platform, i.e. it won't work if > the reset control (or clk, in the next patch) is somehow missing from > the device tree. If the device tree is wrong it is considered ok that the driver doesn't behave correctly. So this is not a problem you need (or should) care about. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |