diff mbox series

[1/2] soc: export soc_device_to_device symbol

Message ID 20210917175134.252882-2-krzysztof.kozlowski@canonical.com (mailing list archive)
State New, archived
Headers show
Series soc: samsung: be a module! | expand

Commit Message

Krzysztof Kozlowski Sept. 17, 2021, 5:51 p.m. UTC
In case if soc-bus drivers are modules soc_device_to_device() has to be
exported.  Since it is trivial, export it as non-GPL.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 drivers/base/soc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Greg Kroah-Hartman Sept. 18, 2021, 7:02 a.m. UTC | #1
On Fri, Sep 17, 2021 at 07:51:33PM +0200, Krzysztof Kozlowski wrote:
> In case if soc-bus drivers are modules soc_device_to_device() has to be
> exported.  Since it is trivial, export it as non-GPL.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
>  drivers/base/soc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/base/soc.c b/drivers/base/soc.c
> index 0af5363a582c..ac8db303daa1 100644
> --- a/drivers/base/soc.c
> +++ b/drivers/base/soc.c
> @@ -41,6 +41,7 @@ struct device *soc_device_to_device(struct soc_device *soc_dev)
>  {
>  	return &soc_dev->dev;
>  }
> +EXPORT_SYMBOL(soc_device_to_device);

I thought we were getting rid of the use of this function, why export it
and not just fix it up instead?

Or am I confused about some other soc device abuse...

thanks,

greg k-h
Krzysztof Kozlowski Sept. 19, 2021, 9:12 a.m. UTC | #2
On 18/09/2021 09:02, Greg Kroah-Hartman wrote:
> On Fri, Sep 17, 2021 at 07:51:33PM +0200, Krzysztof Kozlowski wrote:
>> In case if soc-bus drivers are modules soc_device_to_device() has to be
>> exported.  Since it is trivial, export it as non-GPL.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
>> ---
>>  drivers/base/soc.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/base/soc.c b/drivers/base/soc.c
>> index 0af5363a582c..ac8db303daa1 100644
>> --- a/drivers/base/soc.c
>> +++ b/drivers/base/soc.c
>> @@ -41,6 +41,7 @@ struct device *soc_device_to_device(struct soc_device *soc_dev)
>>  {
>>  	return &soc_dev->dev;
>>  }
>> +EXPORT_SYMBOL(soc_device_to_device);
> 
> I thought we were getting rid of the use of this function, why export it
> and not just fix it up instead?
> 
> Or am I confused about some other soc device abuse...

I was not aware of discussion about soc_device_to_device(). Thanks for
pointing out the issue. I googled a little and found previous talks:
https://lore.kernel.org/lkml/20191111052741.GB3176397@kroah.com/

I can easily get rid of soc_device_to_device() in my driver, so first
patch won't be needed.

Best regards,
Krzysztof
Greg Kroah-Hartman Sept. 19, 2021, 9:24 a.m. UTC | #3
On Sun, Sep 19, 2021 at 11:12:29AM +0200, Krzysztof Kozlowski wrote:
> On 18/09/2021 09:02, Greg Kroah-Hartman wrote:
> > On Fri, Sep 17, 2021 at 07:51:33PM +0200, Krzysztof Kozlowski wrote:
> >> In case if soc-bus drivers are modules soc_device_to_device() has to be
> >> exported.  Since it is trivial, export it as non-GPL.
> >>
> >> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> >> ---
> >>  drivers/base/soc.c | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/drivers/base/soc.c b/drivers/base/soc.c
> >> index 0af5363a582c..ac8db303daa1 100644
> >> --- a/drivers/base/soc.c
> >> +++ b/drivers/base/soc.c
> >> @@ -41,6 +41,7 @@ struct device *soc_device_to_device(struct soc_device *soc_dev)
> >>  {
> >>  	return &soc_dev->dev;
> >>  }
> >> +EXPORT_SYMBOL(soc_device_to_device);
> > 
> > I thought we were getting rid of the use of this function, why export it
> > and not just fix it up instead?
> > 
> > Or am I confused about some other soc device abuse...
> 
> I was not aware of discussion about soc_device_to_device(). Thanks for
> pointing out the issue. I googled a little and found previous talks:
> https://lore.kernel.org/lkml/20191111052741.GB3176397@kroah.com/
> 
> I can easily get rid of soc_device_to_device() in my driver, so first
> patch won't be needed.

Wonderful, thanks for fixing that up.

greg k-h
diff mbox series

Patch

diff --git a/drivers/base/soc.c b/drivers/base/soc.c
index 0af5363a582c..ac8db303daa1 100644
--- a/drivers/base/soc.c
+++ b/drivers/base/soc.c
@@ -41,6 +41,7 @@  struct device *soc_device_to_device(struct soc_device *soc_dev)
 {
 	return &soc_dev->dev;
 }
+EXPORT_SYMBOL(soc_device_to_device);
 
 static umode_t soc_attribute_mode(struct kobject *kobj,
 				struct attribute *attr,