Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6872048ybe; Wed, 18 Sep 2019 10:23:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwk9Ktq5vSLN6eIlc6W58FKv/Q3+KBZ7qzxgmkrLef9kzDdqDF6Rz/mfWowzM+3TkHAAFEw X-Received: by 2002:a50:918d:: with SMTP id g13mr11592385eda.64.1568827387683; Wed, 18 Sep 2019 10:23:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568827387; cv=none; d=google.com; s=arc-20160816; b=U8OXLxBKjaXO44q5EFb1Ff69rd7dhNgFB0e6oxfG6V7yxt4NuoooTM3ri88pEVBlZ9 7JgIAqSRscsaRok4kYVuX/oNscfTrAYBgFDGyZ83uqfnEUKf34ZqKPAcWEtIOAna8gLK RJUfIXwBnZUidCojSGeL+h+drw5ViA3lrKRhKE0EfKWAlrKakf0r26ikWnce2c2pETtL tExAHuma4ROHASRrDOitoYtpKAAOUrKWC57aoDqs8bRZVQOBOfMgTl9WhR1JTRyLAPv0 IiNItVQqUabvpDYlmoDdg5/UEG4+fX0oVOpS7rLKCbGd5kJcsZZStS/22xySj2NXkVu5 /gog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=KPYZ2Ln1PjRbLMEQhZTl+2pdvoeOYC/9vvOAJaCk0LY=; b=qSGvWKLgKjX7t23xgCfeV9ymyKWedT4eqYJAH0Y3LPuoaa/s7zxE5Wb7Ga8+FHgh8n qRutsc4RL0JMAgxUoZ+lv4RWe7Oo6qS4g+bR6JxT+9cf+8MQXy+Jawu2XrxqfKZu1HN7 jstvlTKhJmHvYVfwQNa2J+RT2OyCCpGxDyn8nHJZSw/OqL5yyP99uPntBRQN2YrGHX+/ Xi7yoiNbok8/iY6B1VqUZk8Sk/ygKyz23egQiR8OZLrvlSPtwx4roxHul1d7+QATs46E ksIIPNtYWR8naFnnhqxntmZ7cMVxJQAfeaKiR0odKs0GkhyuRhTKqu/nush9rprFdIwS jqLA== 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 pk19si3103178ejb.257.2019.09.18.10.22.43; Wed, 18 Sep 2019 10:23:07 -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 S1731459AbfIRO5Y (ORCPT + 99 others); Wed, 18 Sep 2019 10:57:24 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:42543 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731382AbfIRO5Y (ORCPT ); Wed, 18 Sep 2019 10:57:24 -0400 Received: from localhost (aclermont-ferrand-651-1-259-53.w86-207.abo.wanadoo.fr [86.207.98.53]) (Authenticated sender: kamel.bouhara@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id B47DC200018; Wed, 18 Sep 2019 14:57:20 +0000 (UTC) From: Kamel Bouhara To: Claudiu Beznea , Thierry Reding , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , linux-arm-kernel@lists.infradead.org, Gregory Clement , Thomas Petazzoni , Kamel Bouhara Subject: [PATCH v2] pwm: atmel: Remove platform_device_id and use only dt bindings Date: Wed, 18 Sep 2019 16:57:16 +0200 Message-Id: <20190918145716.32022-1-kamel.bouhara@bootlin.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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