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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 39836C4CEC4 for ; Wed, 18 Sep 2019 15:11:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 06C8E218AE for ; Wed, 18 Sep 2019 15:11:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fY0ie2jq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06C8E218AE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ES0WAbh8fjIVomIwzHbCaU/MSRGBpSSnU6cQM18E/24=; b=fY0ie2jqp+itJx JeQyNvkXDzD93u0ljtiCFU6b2mejHnn3/JXaqks10fwXAPcoq4bfi2KIFBrh4fZ5ntvfvI/Hn/f2Q M6sXWeuI6nUU66xaND/0DMN85gtlDJ0BxYiFZ/CHGnIheetRI4VJ6ZN4E+uN8H8jm0aCuyN4aTn5o fZaBD7dUFYlSZQAENysVvEB7dTj2KefutaxIKlN83/SBURhVpP6lHXEAMsxj5TWgH4HMJj1ztBiZG QY5ogtJ8fmsQy0h+S2mUkHV9QhPisByejNWHnhldxLpgSLdcrY0zlBKmhx3GdI2wXJtXpltBZmixt njpqoinTtlUI+9BsXU4w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAbc6-0003nb-7j; Wed, 18 Sep 2019 15:11:26 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAbbu-0003ce-Du for linux-arm-kernel@lists.infradead.org; Wed, 18 Sep 2019 15:11:16 +0000 X-Originating-IP: 90.65.161.137 Received: from localhost (lfbn-1-1545-137.w90-65.abo.wanadoo.fr [90.65.161.137]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id A8A1E1BF214; Wed, 18 Sep 2019 15:11:02 +0000 (UTC) Date: Wed, 18 Sep 2019 17:11:00 +0200 From: Alexandre Belloni To: Kamel Bouhara Subject: Re: [PATCH v2] pwm: atmel: Remove platform_device_id and use only dt bindings Message-ID: <20190918151100.GO21254@piout.net> References: <20190918145716.32022-1-kamel.bouhara@bootlin.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190918145716.32022-1-kamel.bouhara@bootlin.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190918_081114_775094_037FF0FE X-CRM114-Status: GOOD ( 17.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pwm@vger.kernel.org, Gregory Clement , linux-kernel@vger.kernel.org, Ludovic Desroches , Thierry Reding , Thomas Petazzoni , Claudiu Beznea , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 18/09/2019 16:57:16+0200, Kamel Bouhara wrote: > Since commit 26202873bb51 ("avr32: remove support for AVR32 > architecture") there is no more user of platform_device_id and we > should only use dt bindings > > Signed-off-by: Kamel Bouhara Acked-by: Alexandre Belloni >cj --- > Changelog: > v1->v2 > > - Remove whole function atmel_pwm_get_driver_data and call > of_device_get_match_data from atmel_pwm_probe > > drivers/pwm/Kconfig | 2 +- > drivers/pwm/pwm-atmel.c | 35 +++-------------------------------- > 2 files changed, 4 insertions(+), 33 deletions(-) > > diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig > index a7e57516959e..b51fb1a33aa2 100644 > --- a/drivers/pwm/Kconfig > +++ b/drivers/pwm/Kconfig > @@ -44,7 +44,7 @@ config PWM_AB8500 > > config PWM_ATMEL > tristate "Atmel PWM support" > - depends on ARCH_AT91 > + depends on ARCH_AT91 && OF > help > Generic PWM framework driver for Atmel SoC. > > diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c > index e5e1eaf372fa..f7cf0a86a37c 100644 > --- a/drivers/pwm/pwm-atmel.c > +++ b/drivers/pwm/pwm-atmel.c > @@ -318,19 +318,6 @@ static const struct atmel_pwm_data mchp_sam9x60_pwm_data = { > }, > }; > > -static const struct platform_device_id atmel_pwm_devtypes[] = { > - { > - .name = "at91sam9rl-pwm", > - .driver_data = (kernel_ulong_t)&atmel_sam9rl_pwm_data, > - }, { > - .name = "sama5d3-pwm", > - .driver_data = (kernel_ulong_t)&atmel_sama5_pwm_data, > - }, { > - /* sentinel */ > - }, > -}; > -MODULE_DEVICE_TABLE(platform, atmel_pwm_devtypes); > - > static const struct of_device_id atmel_pwm_dt_ids[] = { > { > .compatible = "atmel,at91sam9rl-pwm", > @@ -350,19 +337,6 @@ static const struct of_device_id atmel_pwm_dt_ids[] = { > }; > MODULE_DEVICE_TABLE(of, atmel_pwm_dt_ids); > > -static inline const struct atmel_pwm_data * > -atmel_pwm_get_driver_data(struct platform_device *pdev) > -{ > - const struct platform_device_id *id; > - > - if (pdev->dev.of_node) > - return of_device_get_match_data(&pdev->dev); > - > - id = platform_get_device_id(pdev); > - > - return (struct atmel_pwm_data *)id->driver_data; > -} > - > static int atmel_pwm_probe(struct platform_device *pdev) > { > const struct atmel_pwm_data *data; > @@ -370,7 +344,7 @@ static int atmel_pwm_probe(struct platform_device *pdev) > struct resource *res; > int ret; > > - data = atmel_pwm_get_driver_data(pdev); > + data = of_device_get_match_data(&pdev->dev); > if (!data) > return -ENODEV; > > @@ -396,10 +370,8 @@ static int atmel_pwm_probe(struct platform_device *pdev) > atmel_pwm->chip.dev = &pdev->dev; > atmel_pwm->chip.ops = &atmel_pwm_ops; > > - if (pdev->dev.of_node) { > - atmel_pwm->chip.of_xlate = of_pwm_xlate_with_flags; > - atmel_pwm->chip.of_pwm_n_cells = 3; > - } > + atmel_pwm->chip.of_xlate = of_pwm_xlate_with_flags; > + atmel_pwm->chip.of_pwm_n_cells = 3; > > atmel_pwm->chip.base = -1; > atmel_pwm->chip.npwm = 4; > @@ -437,7 +409,6 @@ static struct platform_driver atmel_pwm_driver = { > .name = "atmel-pwm", > .of_match_table = of_match_ptr(atmel_pwm_dt_ids), > }, > - .id_table = atmel_pwm_devtypes, > .probe = atmel_pwm_probe, > .remove = atmel_pwm_remove, > }; > -- > 2.23.0 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel