[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190816073448.37cb7imxnnjdwlix@pengutronix.de>
Date: Fri, 16 Aug 2019 09:34:48 +0200
From: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
To: Sam Shih <sam.shih@...iatek.com>
Cc: Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Matthias Brugger <matthias.bgg@...il.com>,
Thierry Reding <thierry.reding@...il.com>,
Ryder Lee <ryder.lee@...iatek.com>,
John Crispin <john@...ozen.org>, linux-pwm@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH v3 1/10] pwm: mediatek: add a property "num-pwms"
On Fri, Aug 16, 2019 at 03:21:19PM +0800, Sam Shih wrote:
> From: Ryder Lee <ryder.lee@...iatek.com>
>
> 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 <ryder.lee@...iatek.com>
> Signed-off-by: Sam Shih <sam.shih@...iatek.com>
> ---
> 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/ |
Powered by blists - more mailing lists