From: <Nicolas.Ferre@microchip.com>
To: <alexandre.belloni@bootlin.com>, <linux-rtc@vger.kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/6] rtc: at91sam9: drop platform_data support
Date: Thu, 21 Mar 2019 10:11:51 +0000 [thread overview]
Message-ID: <d244f811-8133-efac-4601-24b286ca98d8@microchip.com> (raw)
In-Reply-To: <20190320124042.14141-1-alexandre.belloni@bootlin.com>
On 20/03/2019 at 13:40, Alexandre Belloni wrote:
> ARCH_AT91 is DT only for a while, drop platform data support.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
For the whole series:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> ---
> drivers/rtc/Kconfig | 2 +-
> drivers/rtc/rtc-at91sam9.c | 44 +++++++-------------------------------
> 2 files changed, 9 insertions(+), 37 deletions(-)
>
> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> index 7555fd344ff0..fa5638269b33 100644
> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -1432,7 +1432,7 @@ config RTC_DRV_AT91RM9200
> config RTC_DRV_AT91SAM9
> tristate "AT91SAM9 RTT as RTC"
> depends on ARCH_AT91 || COMPILE_TEST
> - depends on HAS_IOMEM
> + depends on OF && HAS_IOMEM
> select MFD_SYSCON
> help
> Some AT91SAM9 SoCs provide an RTT (Real Time Timer) block which
> diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
> index 1d31c0ae6334..7ec114b59513 100644
> --- a/drivers/rtc/rtc-at91sam9.c
> +++ b/drivers/rtc/rtc-at91sam9.c
> @@ -340,13 +340,6 @@ static const struct rtc_class_ops at91_rtc_ops = {
> .alarm_irq_enable = at91_rtc_alarm_irq_enable,
> };
>
> -static const struct regmap_config gpbr_regmap_config = {
> - .name = "gpbr",
> - .reg_bits = 32,
> - .val_bits = 32,
> - .reg_stride = 4,
> -};
> -
> /*
> * Initialize and install RTC driver
> */
> @@ -357,6 +350,7 @@ static int at91_rtc_probe(struct platform_device *pdev)
> int ret, irq;
> u32 mr;
> unsigned int sclk_rate;
> + struct of_phandle_args args;
>
> irq = platform_get_irq(pdev, 0);
> if (irq < 0) {
> @@ -382,34 +376,14 @@ static int at91_rtc_probe(struct platform_device *pdev)
> if (IS_ERR(rtc->rtt))
> return PTR_ERR(rtc->rtt);
>
> - if (!pdev->dev.of_node) {
> - /*
> - * TODO: Remove this code chunk when removing non DT board
> - * support. Remember to remove the gpbr_regmap_config
> - * variable too.
> - */
> - void __iomem *gpbr;
> -
> - r = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - gpbr = devm_ioremap_resource(&pdev->dev, r);
> - if (IS_ERR(gpbr))
> - return PTR_ERR(gpbr);
> -
> - rtc->gpbr = regmap_init_mmio(NULL, gpbr,
> - &gpbr_regmap_config);
> - } else {
> - struct of_phandle_args args;
> -
> - ret = of_parse_phandle_with_fixed_args(pdev->dev.of_node,
> - "atmel,rtt-rtc-time-reg", 1, 0,
> - &args);
> - if (ret)
> - return ret;
> -
> - rtc->gpbr = syscon_node_to_regmap(args.np);
> - rtc->gpbr_offset = args.args[0];
> - }
> + ret = of_parse_phandle_with_fixed_args(pdev->dev.of_node,
> + "atmel,rtt-rtc-time-reg", 1, 0,
> + &args);
> + if (ret)
> + return ret;
>
> + rtc->gpbr = syscon_node_to_regmap(args.np);
> + rtc->gpbr_offset = args.args[0];
> if (IS_ERR(rtc->gpbr)) {
> dev_err(&pdev->dev, "failed to retrieve gpbr regmap, aborting.\n");
> return -ENOMEM;
> @@ -561,13 +535,11 @@ static int at91_rtc_resume(struct device *dev)
>
> static SIMPLE_DEV_PM_OPS(at91_rtc_pm_ops, at91_rtc_suspend, at91_rtc_resume);
>
> -#ifdef CONFIG_OF
> static const struct of_device_id at91_rtc_dt_ids[] = {
> { .compatible = "atmel,at91sam9260-rtt" },
> { /* sentinel */ }
> };
> MODULE_DEVICE_TABLE(of, at91_rtc_dt_ids);
> -#endif
>
> static struct platform_driver at91_rtc_driver = {
> .probe = at91_rtc_probe,
>
--
Nicolas Ferre
prev parent reply other threads:[~2019-03-21 10:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-20 12:40 Alexandre Belloni
2019-03-20 12:40 ` [PATCH 2/6] rtc: at91sam9: convert to devm_rtc_allocate_device Alexandre Belloni
2019-03-20 12:40 ` [PATCH 3/6] rtc: at91sam9: set range Alexandre Belloni
2019-03-20 12:40 ` [PATCH 4/6] rtc: at91sam9: switch to rtc_time64_to_tm/rtc_tm_to_time64 Alexandre Belloni
2019-03-20 12:40 ` [PATCH 5/6] rtc: at91sam9: convert to SPDX identifier Alexandre Belloni
2019-03-20 12:40 ` [PATCH 6/6] rtc: at91sam9: correct trivial checkpatch warnings Alexandre Belloni
2019-03-21 10:11 ` Nicolas.Ferre [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d244f811-8133-efac-4601-24b286ca98d8@microchip.com \
--to=nicolas.ferre@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®