Commit 24e1f2c9 authored by Paul Cercueil's avatar Paul Cercueil Committed by Alexandre Belloni

rtc: ingenic: Only support probing from devicetree

With the recent work on supporting Device Tree on Ingenic SoCs, no
driver ever probes from platform code anymore, so we can clean a bit
this driver by removing the non-devicetree paths.
Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20200505221336.222313-1-paul@crapouillou.netSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 8816cd72
...@@ -1680,6 +1680,7 @@ config RTC_DRV_MPC5121 ...@@ -1680,6 +1680,7 @@ config RTC_DRV_MPC5121
config RTC_DRV_JZ4740 config RTC_DRV_JZ4740
tristate "Ingenic JZ4740 SoC" tristate "Ingenic JZ4740 SoC"
depends on MIPS || COMPILE_TEST depends on MIPS || COMPILE_TEST
depends on OF
help help
If you say yes here you get support for the Ingenic JZ47xx SoCs RTC If you say yes here you get support for the Ingenic JZ47xx SoCs RTC
controllers. controllers.
......
...@@ -309,19 +309,13 @@ static int jz4740_rtc_probe(struct platform_device *pdev) ...@@ -309,19 +309,13 @@ static int jz4740_rtc_probe(struct platform_device *pdev)
{ {
int ret; int ret;
struct jz4740_rtc *rtc; struct jz4740_rtc *rtc;
const struct platform_device_id *id = platform_get_device_id(pdev);
const struct of_device_id *of_id = of_match_device(
jz4740_rtc_of_match, &pdev->dev);
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL); rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
if (!rtc) if (!rtc)
return -ENOMEM; return -ENOMEM;
if (of_id) rtc->type = (enum jz4740_rtc_type)device_get_match_data(dev);
rtc->type = (enum jz4740_rtc_type)of_id->data;
else
rtc->type = id->driver_data;
rtc->irq = platform_get_irq(pdev, 0); rtc->irq = platform_get_irq(pdev, 0);
if (rtc->irq < 0) if (rtc->irq < 0)
...@@ -370,7 +364,7 @@ static int jz4740_rtc_probe(struct platform_device *pdev) ...@@ -370,7 +364,7 @@ static int jz4740_rtc_probe(struct platform_device *pdev)
return ret; return ret;
} }
if (np && of_device_is_system_power_controller(np)) { if (of_device_is_system_power_controller(np)) {
if (!pm_power_off) { if (!pm_power_off) {
/* Default: 60ms */ /* Default: 60ms */
rtc->reset_pin_assert_time = 60; rtc->reset_pin_assert_time = 60;
...@@ -395,20 +389,12 @@ static int jz4740_rtc_probe(struct platform_device *pdev) ...@@ -395,20 +389,12 @@ static int jz4740_rtc_probe(struct platform_device *pdev)
return 0; return 0;
} }
static const struct platform_device_id jz4740_rtc_ids[] = {
{ "jz4740-rtc", ID_JZ4740 },
{ "jz4780-rtc", ID_JZ4780 },
{}
};
MODULE_DEVICE_TABLE(platform, jz4740_rtc_ids);
static struct platform_driver jz4740_rtc_driver = { static struct platform_driver jz4740_rtc_driver = {
.probe = jz4740_rtc_probe, .probe = jz4740_rtc_probe,
.driver = { .driver = {
.name = "jz4740-rtc", .name = "jz4740-rtc",
.of_match_table = of_match_ptr(jz4740_rtc_of_match), .of_match_table = jz4740_rtc_of_match,
}, },
.id_table = jz4740_rtc_ids,
}; };
module_platform_driver(jz4740_rtc_driver); module_platform_driver(jz4740_rtc_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment