Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp596516ybl; Fri, 16 Aug 2019 00:38:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0gjJu99c8zUEC1Wpm31szqslzT4uqrtkZm46fqNeB/lCP1Zvaz2KrsI0agKU+5dEePKIB X-Received: by 2002:a62:e901:: with SMTP id j1mr9611721pfh.189.1565941091625; Fri, 16 Aug 2019 00:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565941091; cv=none; d=google.com; s=arc-20160816; b=GnVDHtNiIL9GrvdNIpeQCRm2HsphXFm1J9mX6C3d1YDkf5+FZMd2NT32pGqnv1iKUM 1xgxcFc7s+wV6Yj/837L2+L1Tl+kH7qYhp70WusnzvZHKvzDdhzGrnoXyTEqkGiDCa1v WYqetKZeip0AZNisCdxYj8XuVZuFdOAQsQkM1KQfoulAV9FP3OpHF17g7nNt64aod0E7 MbtaUDx629/kEk11kgG+qjEb3ySZJhX2D7T7B/jA3weH7w50s2P/uifLvDKPHyUqJwx8 sOSbw7nt2X9qYCz8ybdfRCaqeFzEzcZ7sUyNXYArp9wEDo0C1JefxmIIWc+OUBFdLKeP oSAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=+PKz+B9bE3F1LvvHHvqZyYIOjMAaF6PrDUt2z/W/6Yc=; b=D+7rZizNXICcyL1+wQePwLJpxdcgw0kAIOMskpciG3Ulabmbqak9fPALyzNKysdxGC 31m+n5NeGQ7U1sDwswSZJlKIgRCn6IrM2H8mkiiqV6yEww47GyC4SfXQQplZgOv24KtO uBhZjS7MevMUQQYjQ3de5q+g6HYwXBNqJ4GzWpT1yN1LBdT/5T3us6Ogc9FQ9OlqXYQP 5lf7+rBZ5N6SVr9KY7xeCgBBowJXZDf84AFp/zxgdL1w0jpE6ftnKzwOXU43cdRBTtw4 A/97qT8lWJaGQLGm7Sv42x2q6L8QQCa+eENicSPOk53UJ6FvLq20BwUc1iVmWGObDI6R ML4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s23si3318925pgm.345.2019.08.16.00.37.47; Fri, 16 Aug 2019 00:38:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726820AbfHPHfB (ORCPT + 99 others); Fri, 16 Aug 2019 03:35:01 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:56715 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726596AbfHPHfA (ORCPT ); Fri, 16 Aug 2019 03:35:00 -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 1hyWl7-00046x-Ue; Fri, 16 Aug 2019 09:34:49 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1hyWl6-0007vt-Mo; Fri, 16 Aug 2019 09:34:48 +0200 Date: Fri, 16 Aug 2019 09:34:48 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Sam Shih Cc: Rob Herring , Mark Rutland , Matthias Brugger , Thierry Reding , Ryder Lee , John Crispin , linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH v3 1/10] pwm: mediatek: add a property "num-pwms" Message-ID: <20190816073448.37cb7imxnnjdwlix@pengutronix.de> References: <1565940088-845-1-git-send-email-sam.shih@mediatek.com> <1565940088-845-2-git-send-email-sam.shih@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1565940088-845-2-git-send-email-sam.shih@mediatek.com> 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 On Fri, Aug 16, 2019 at 03:21:19PM +0800, Sam Shih wrote: > From: Ryder Lee > > This adds a property "num-pwms" to avoid having an endless > list of compatibles with no differences for the same driver. > > Signed-off-by: Ryder Lee > Signed-off-by: Sam Shih > --- > drivers/pwm/pwm-mediatek.c | 35 ++++++++++++++++++++++------------- > 1 file changed, 22 insertions(+), 13 deletions(-) > > diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c > index eb6674ce995f..f9d67fb66adb 100644 > --- a/drivers/pwm/pwm-mediatek.c > +++ b/drivers/pwm/pwm-mediatek.c > @@ -55,7 +55,7 @@ static const char * const mtk_pwm_clk_name[MTK_CLK_MAX] = { > }; > > struct mtk_pwm_platform_data { > - unsigned int num_pwms; > + unsigned int fallback_npwms; > bool pwm45_fixup; > bool has_clks; > }; > @@ -226,27 +226,36 @@ static const struct pwm_ops mtk_pwm_ops = { > > static int mtk_pwm_probe(struct platform_device *pdev) > { > - const struct mtk_pwm_platform_data *data; > + struct device_node *np = pdev->dev.of_node; > struct mtk_pwm_chip *pc; > struct resource *res; > - unsigned int i; > + unsigned int i, npwms; > int ret; > > pc = devm_kzalloc(&pdev->dev, sizeof(*pc), GFP_KERNEL); > if (!pc) > return -ENOMEM; > > - data = of_device_get_match_data(&pdev->dev); > - if (data == NULL) > - return -EINVAL; > - pc->soc = data; > + pc->soc = of_device_get_match_data(&pdev->dev); Droping the check for of_device_get_match_data returning non-NULL is unrelated to the official patch's topic. Other than that I like this patch. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |