diff mbox series

[v4,5/7] watchdog: bcm7038_wdt: Add platform device id for bcm63xx-wdt

Message ID 20211105154208.614260-6-f.fainelli@gmail.com (mailing list archive)
State New, archived
Headers show
Series Removal of bcm63xx-wdt | expand

Commit Message

Florian Fainelli Nov. 5, 2021, 3:42 p.m. UTC
In order to phase out bcm63xx_wdt and use bcm7038_wdt instead, introduce
a platform_device_id table that allows both names to be matched.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/watchdog/bcm7038_wdt.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Rafał Miłecki Nov. 9, 2021, 10:38 a.m. UTC | #1
On 05.11.2021 16:42, Florian Fainelli wrote:
> In order to phase out bcm63xx_wdt and use bcm7038_wdt instead, introduce
> a platform_device_id table that allows both names to be matched.
> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>   drivers/watchdog/bcm7038_wdt.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/watchdog/bcm7038_wdt.c b/drivers/watchdog/bcm7038_wdt.c
> index 506cd7ef9c77..a8a0e8485125 100644
> --- a/drivers/watchdog/bcm7038_wdt.c
> +++ b/drivers/watchdog/bcm7038_wdt.c
> @@ -223,8 +223,16 @@ static const struct of_device_id bcm7038_wdt_match[] = {
>   };
>   MODULE_DEVICE_TABLE(of, bcm7038_wdt_match);
>   
> +static const struct platform_device_id bcm7038_wdt_devtype[] = {
> +	{ .name = "bcm7038-wdt" },
> +	{ .name = "bcm63xx-wdt" },
> +	{ /* sentinel */ },
> +};

I don't think I received answer on this: do we really need or want
"bcm7038-wdt" there? BCM7038 uses DT so it should never use a platform
devices created by arch code.
Florian Fainelli Nov. 12, 2021, 10:43 p.m. UTC | #2
On 11/9/21 2:38 AM, Rafał Miłecki wrote:
> On 05.11.2021 16:42, Florian Fainelli wrote:
>> In order to phase out bcm63xx_wdt and use bcm7038_wdt instead, introduce
>> a platform_device_id table that allows both names to be matched.
>>
>> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>   drivers/watchdog/bcm7038_wdt.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/watchdog/bcm7038_wdt.c
>> b/drivers/watchdog/bcm7038_wdt.c
>> index 506cd7ef9c77..a8a0e8485125 100644
>> --- a/drivers/watchdog/bcm7038_wdt.c
>> +++ b/drivers/watchdog/bcm7038_wdt.c
>> @@ -223,8 +223,16 @@ static const struct of_device_id
>> bcm7038_wdt_match[] = {
>>   };
>>   MODULE_DEVICE_TABLE(of, bcm7038_wdt_match);
>>   +static const struct platform_device_id bcm7038_wdt_devtype[] = {
>> +    { .name = "bcm7038-wdt" },
>> +    { .name = "bcm63xx-wdt" },
>> +    { /* sentinel */ },
>> +};
> 
> I don't think I received answer on this: do we really need or want
> "bcm7038-wdt" there? BCM7038 uses DT so it should never use a platform
> devices created by arch code.

I did not respond to you on that, tested it and turned out we don't need
that bcm7038-wdt string when probed via DT, but we do when probed via
platform_data. Will drop it.
diff mbox series

Patch

diff --git a/drivers/watchdog/bcm7038_wdt.c b/drivers/watchdog/bcm7038_wdt.c
index 506cd7ef9c77..a8a0e8485125 100644
--- a/drivers/watchdog/bcm7038_wdt.c
+++ b/drivers/watchdog/bcm7038_wdt.c
@@ -223,8 +223,16 @@  static const struct of_device_id bcm7038_wdt_match[] = {
 };
 MODULE_DEVICE_TABLE(of, bcm7038_wdt_match);
 
+static const struct platform_device_id bcm7038_wdt_devtype[] = {
+	{ .name = "bcm7038-wdt" },
+	{ .name = "bcm63xx-wdt" },
+	{ /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(platform, bcm7038_wdt_devtype);
+
 static struct platform_driver bcm7038_wdt_driver = {
 	.probe		= bcm7038_wdt_probe,
+	.id_table	= bcm7038_wdt_devtype,
 	.driver		= {
 		.name		= "bcm7038-wdt",
 		.of_match_table	= bcm7038_wdt_match,