All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: sec: Export OF module alias table
@ 2018-07-25 15:53 Krzysztof Kozlowski
  2018-07-27  8:27 ` Lee Jones
  2018-08-03 23:30 ` Javier Martinez Canillas
  0 siblings, 2 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2018-07-25 15:53 UTC (permalink / raw)
  To: Sangbeom Kim, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
	Lee Jones, linux-kernel, linux-samsung-soc

In case of Device Tree platforms, even though the Samsung PMIC sec
device is instantiated from DT, the driver is still matched through I2C
module alias.  That is because I2C core always reports an I2C module
alias instead of DT one.

This could change in the future so export DT module alias.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/mfd/sec-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index ca6b80d08ffc..9613b4257302 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -146,6 +146,7 @@ static const struct of_device_id sec_dt_match[] = {
 		/* Sentinel */
 	},
 };
+MODULE_DEVICE_TABLE(of, sec_dt_match);
 #endif
 
 static bool s2mpa01_volatile(struct device *dev, unsigned int reg)
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mfd: sec: Export OF module alias table
  2018-07-25 15:53 [PATCH] mfd: sec: Export OF module alias table Krzysztof Kozlowski
@ 2018-07-27  8:27 ` Lee Jones
  2018-08-03 23:30 ` Javier Martinez Canillas
  1 sibling, 0 replies; 5+ messages in thread
From: Lee Jones @ 2018-07-27  8:27 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sangbeom Kim, Bartlomiej Zolnierkiewicz, linux-kernel, linux-samsung-soc

On Wed, 25 Jul 2018, Krzysztof Kozlowski wrote:

> In case of Device Tree platforms, even though the Samsung PMIC sec
> device is instantiated from DT, the driver is still matched through I2C
> module alias.  That is because I2C core always reports an I2C module
> alias instead of DT one.
> 
> This could change in the future so export DT module alias.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/mfd/sec-core.c | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mfd: sec: Export OF module alias table
  2018-07-25 15:53 [PATCH] mfd: sec: Export OF module alias table Krzysztof Kozlowski
  2018-07-27  8:27 ` Lee Jones
@ 2018-08-03 23:30 ` Javier Martinez Canillas
  2018-08-07  9:21     ` Krzysztof Kozlowski
  1 sibling, 1 reply; 5+ messages in thread
From: Javier Martinez Canillas @ 2018-08-03 23:30 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sangbeom Kim, Bartlomiej Zolnierkiewicz, Lee Jones, Linux Kernel,
	linux-samsung-soc

Hi Krzysztof,

On Wed, Jul 25, 2018 at 5:53 PM, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> In case of Device Tree platforms, even though the Samsung PMIC sec
> device is instantiated from DT, the driver is still matched through I2C
> module alias.  That is because I2C core always reports an I2C module
> alias instead of DT one.
>

Just a heads up that this already changed in v4.17 since commit
af503716ac1 ("i2c: core: report OF style module alias for devices
registered via OF").

> This could change in the future so export DT module alias.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/mfd/sec-core.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
> index ca6b80d08ffc..9613b4257302 100644
> --- a/drivers/mfd/sec-core.c
> +++ b/drivers/mfd/sec-core.c
> @@ -146,6 +146,7 @@ static const struct of_device_id sec_dt_match[] = {
>                 /* Sentinel */
>         },
>  };
> +MODULE_DEVICE_TABLE(of, sec_dt_match);

This driver can't be built as a module since its config symbol is
bool, so technically this macro isn't needed. But it's a no-op when
the driver is built-in so it's harmless to have it.

Best regards,
Javier

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mfd: sec: Export OF module alias table
  2018-08-03 23:30 ` Javier Martinez Canillas
@ 2018-08-07  9:21     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2018-08-07  9:21 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: Sangbeom Kim, Bartlomiej Zolnierkiewicz, Lee Jones, Linux Kernel,
	linux-samsung-soc

On 4 August 2018 at 01:30, Javier Martinez Canillas <javier@dowhile0.org> wrote:
> Hi Krzysztof,
>
> On Wed, Jul 25, 2018 at 5:53 PM, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>> In case of Device Tree platforms, even though the Samsung PMIC sec
>> device is instantiated from DT, the driver is still matched through I2C
>> module alias.  That is because I2C core always reports an I2C module
>> alias instead of DT one.
>>
>
> Just a heads up that this already changed in v4.17 since commit
> af503716ac1 ("i2c: core: report OF style module alias for devices
> registered via OF").

True, I missed that part and blindly followed the old principle.

>
>> This could change in the future so export DT module alias.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
>> ---
>>  drivers/mfd/sec-core.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
>> index ca6b80d08ffc..9613b4257302 100644
>> --- a/drivers/mfd/sec-core.c
>> +++ b/drivers/mfd/sec-core.c
>> @@ -146,6 +146,7 @@ static const struct of_device_id sec_dt_match[] = {
>>                 /* Sentinel */
>>         },
>>  };
>> +MODULE_DEVICE_TABLE(of, sec_dt_match);
>
> This driver can't be built as a module since its config symbol is
> bool, so technically this macro isn't needed. But it's a no-op when
> the driver is built-in so it's harmless to have it.

Indeed. I tried converting it to module but that does not work in all
configurations (regulators are needed early).

Anyway my patch even though not that correct, it should not bring any issues.

Thanks for valuable feedback!

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mfd: sec: Export OF module alias table
@ 2018-08-07  9:21     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2018-08-07  9:21 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: Sangbeom Kim, Bartlomiej Zolnierkiewicz, Lee Jones, Linux Kernel,
	linux-samsung-soc

On 4 August 2018 at 01:30, Javier Martinez Canillas <javier@dowhile0.org> wrote:
> Hi Krzysztof,
>
> On Wed, Jul 25, 2018 at 5:53 PM, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>> In case of Device Tree platforms, even though the Samsung PMIC sec
>> device is instantiated from DT, the driver is still matched through I2C
>> module alias.  That is because I2C core always reports an I2C module
>> alias instead of DT one.
>>
>
> Just a heads up that this already changed in v4.17 since commit
> af503716ac1 ("i2c: core: report OF style module alias for devices
> registered via OF").

True, I missed that part and blindly followed the old principle.

>
>> This could change in the future so export DT module alias.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
>> ---
>>  drivers/mfd/sec-core.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
>> index ca6b80d08ffc..9613b4257302 100644
>> --- a/drivers/mfd/sec-core.c
>> +++ b/drivers/mfd/sec-core.c
>> @@ -146,6 +146,7 @@ static const struct of_device_id sec_dt_match[] = {
>>                 /* Sentinel */
>>         },
>>  };
>> +MODULE_DEVICE_TABLE(of, sec_dt_match);
>
> This driver can't be built as a module since its config symbol is
> bool, so technically this macro isn't needed. But it's a no-op when
> the driver is built-in so it's harmless to have it.

Indeed. I tried converting it to module but that does not work in all
configurations (regulators are needed early).

Anyway my patch even though not that correct, it should not bring any issues.

Thanks for valuable feedback!

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-07  9:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-25 15:53 [PATCH] mfd: sec: Export OF module alias table Krzysztof Kozlowski
2018-07-27  8:27 ` Lee Jones
2018-08-03 23:30 ` Javier Martinez Canillas
2018-08-07  9:21   ` Krzysztof Kozlowski
2018-08-07  9:21     ` Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.