diff mbox

[03/32] OMAPDSS: add omap_dss_find_output()

Message ID 1369906493-27538-4-git-send-email-tomi.valkeinen@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomi Valkeinen May 30, 2013, 9:34 a.m. UTC
Add a support function to find a DSS output by given name. This is used
in later patches to link the panels to DSS outputs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/omap2/dss/output.c | 13 +++++++++++++
 include/video/omapdss.h          |  1 +
 2 files changed, 14 insertions(+)

Comments

Jean-Christophe PLAGNIOL-VILLARD May 30, 2013, 11:07 a.m. UTC | #1
On 12:34 Thu 30 May     , Tomi Valkeinen wrote:
> Add a support function to find a DSS output by given name. This is used
> in later patches to link the panels to DSS outputs.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/video/omap2/dss/output.c | 13 +++++++++++++
>  include/video/omapdss.h          |  1 +
>  2 files changed, 14 insertions(+)
> 
> diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c
> index 5214df6..3274628 100644
> --- a/drivers/video/omap2/dss/output.c
> +++ b/drivers/video/omap2/dss/output.c
> @@ -115,6 +115,19 @@ struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id)
>  }
>  EXPORT_SYMBOL(omap_dss_get_output);
GPL please
>  
> +struct omap_dss_output *omap_dss_find_output(const char *name)
> +{
> +	struct omap_dss_output *out;
> +
> +	list_for_each_entry(out, &output_list, list) {
> +		if (strcmp(out->name, name) == 0)
> +			return out;
> +	}
> +
> +	return NULL;
> +}
I this in so many drivers could we have a macro to generate such function?

> +EXPORT_SYMBOL(omap_dss_find_output);
ditto GPL

Best Regards,
J.
> +
>  static const struct dss_mgr_ops *dss_mgr_ops;
>  
>  int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops)
> diff --git a/include/video/omapdss.h b/include/video/omapdss.h
> index d5f1fff..aad47a2 100644
> --- a/include/video/omapdss.h
> +++ b/include/video/omapdss.h
> @@ -779,6 +779,7 @@ int omap_dss_get_num_overlays(void);
>  struct omap_overlay *omap_dss_get_overlay(int num);
>  
>  struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id);
> +struct omap_dss_output *omap_dss_find_output(const char *name);
>  int omapdss_output_set_device(struct omap_dss_output *out,
>  		struct omap_dss_device *dssdev);
>  int omapdss_output_unset_device(struct omap_dss_output *out);
> -- 
> 1.8.1.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomi Valkeinen May 30, 2013, 11:40 a.m. UTC | #2
On 30/05/13 14:07, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 12:34 Thu 30 May     , Tomi Valkeinen wrote:
>> Add a support function to find a DSS output by given name. This is used
>> in later patches to link the panels to DSS outputs.
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> ---
>>  drivers/video/omap2/dss/output.c | 13 +++++++++++++
>>  include/video/omapdss.h          |  1 +
>>  2 files changed, 14 insertions(+)
>>
>> diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c
>> index 5214df6..3274628 100644
>> --- a/drivers/video/omap2/dss/output.c
>> +++ b/drivers/video/omap2/dss/output.c
>> @@ -115,6 +115,19 @@ struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id)
>>  }
>>  EXPORT_SYMBOL(omap_dss_get_output);
> GPL please

The omapdss driver uses EXPORT_SYMBOL. I don't want to start mixing both
EXPORT_SYMBOLs and EXPORT_SYMBOL_GPLs.

>> +struct omap_dss_output *omap_dss_find_output(const char *name)
>> +{
>> +	struct omap_dss_output *out;
>> +
>> +	list_for_each_entry(out, &output_list, list) {
>> +		if (strcmp(out->name, name) == 0)
>> +			return out;
>> +	}
>> +
>> +	return NULL;
>> +}
> I this in so many drivers could we have a macro to generate such function?

What would that help? Wouldn't it just increase the code size of the kernel?

 Tomi
Jean-Christophe PLAGNIOL-VILLARD May 30, 2013, 3:40 p.m. UTC | #3
On 14:40 Thu 30 May     , Tomi Valkeinen wrote:
> On 30/05/13 14:07, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 12:34 Thu 30 May     , Tomi Valkeinen wrote:
> >> Add a support function to find a DSS output by given name. This is used
> >> in later patches to link the panels to DSS outputs.
> >>
> >> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> >> ---
> >>  drivers/video/omap2/dss/output.c | 13 +++++++++++++
> >>  include/video/omapdss.h          |  1 +
> >>  2 files changed, 14 insertions(+)
> >>
> >> diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c
> >> index 5214df6..3274628 100644
> >> --- a/drivers/video/omap2/dss/output.c
> >> +++ b/drivers/video/omap2/dss/output.c
> >> @@ -115,6 +115,19 @@ struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id)
> >>  }
> >>  EXPORT_SYMBOL(omap_dss_get_output);
> > GPL please
> 
> The omapdss driver uses EXPORT_SYMBOL. I don't want to start mixing both
> EXPORT_SYMBOLs and EXPORT_SYMBOL_GPLs.

I do not like EXPORT_SYMBOL at all
I stringly prefer to switch all of them to _GPL

but will not refuse the patch for this in this case
> 
> >> +struct omap_dss_output *omap_dss_find_output(const char *name)
> >> +{
> >> +	struct omap_dss_output *out;
> >> +
> >> +	list_for_each_entry(out, &output_list, list) {
> >> +		if (strcmp(out->name, name) == 0)
> >> +			return out;
> >> +	}
> >> +
> >> +	return NULL;
> >> +}
> > I this in so many drivers could we have a macro to generate such function?
> 
> What would that help? Wouldn't it just increase the code size of the kernel?

increase no as it's not an inline function but a macro to generate the
function
after help yes but people may not like so as you wish

Best Regards,
J.
> 
>  Tomi
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomi Valkeinen May 30, 2013, 4:54 p.m. UTC | #4
On 30/05/13 18:40, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 14:40 Thu 30 May     , Tomi Valkeinen wrote:
>> On 30/05/13 14:07, Jean-Christophe PLAGNIOL-VILLARD wrote:
>>> On 12:34 Thu 30 May     , Tomi Valkeinen wrote:
>>>> Add a support function to find a DSS output by given name. This is used
>>>> in later patches to link the panels to DSS outputs.
>>>>
>>>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
>>>> ---
>>>>  drivers/video/omap2/dss/output.c | 13 +++++++++++++
>>>>  include/video/omapdss.h          |  1 +
>>>>  2 files changed, 14 insertions(+)
>>>>
>>>> diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c
>>>> index 5214df6..3274628 100644
>>>> --- a/drivers/video/omap2/dss/output.c
>>>> +++ b/drivers/video/omap2/dss/output.c
>>>> @@ -115,6 +115,19 @@ struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id)
>>>>  }
>>>>  EXPORT_SYMBOL(omap_dss_get_output);
>>> GPL please
>>
>> The omapdss driver uses EXPORT_SYMBOL. I don't want to start mixing both
>> EXPORT_SYMBOLs and EXPORT_SYMBOL_GPLs.
> 
> I do not like EXPORT_SYMBOL at all
> I stringly prefer to switch all of them to _GPL
> 
> but will not refuse the patch for this in this case

I have nothing against changing omapdss to use _GPL only. I've never
heard anyone using non-GPL panel drivers with omap.

Following these patch sets I can remove lots of the old code, which
contains the majority of the EXPORT_SYMBOLs in omapdss. I'll change
omapdss to use _GPL after that removal.

>>>> +struct omap_dss_output *omap_dss_find_output(const char *name)
>>>> +{
>>>> +	struct omap_dss_output *out;
>>>> +
>>>> +	list_for_each_entry(out, &output_list, list) {
>>>> +		if (strcmp(out->name, name) == 0)
>>>> +			return out;
>>>> +	}
>>>> +
>>>> +	return NULL;
>>>> +}
>>> I this in so many drivers could we have a macro to generate such function?
>>
>> What would that help? Wouldn't it just increase the code size of the kernel?
> 
> increase no as it's not an inline function but a macro to generate the
> function
> after help yes but people may not like so as you wish

I don't think I understand what you mean then. What kind of macro are
you talking about?

 Tomi
diff mbox

Patch

diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c
index 5214df6..3274628 100644
--- a/drivers/video/omap2/dss/output.c
+++ b/drivers/video/omap2/dss/output.c
@@ -115,6 +115,19 @@  struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id)
 }
 EXPORT_SYMBOL(omap_dss_get_output);
 
+struct omap_dss_output *omap_dss_find_output(const char *name)
+{
+	struct omap_dss_output *out;
+
+	list_for_each_entry(out, &output_list, list) {
+		if (strcmp(out->name, name) == 0)
+			return out;
+	}
+
+	return NULL;
+}
+EXPORT_SYMBOL(omap_dss_find_output);
+
 static const struct dss_mgr_ops *dss_mgr_ops;
 
 int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index d5f1fff..aad47a2 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -779,6 +779,7 @@  int omap_dss_get_num_overlays(void);
 struct omap_overlay *omap_dss_get_overlay(int num);
 
 struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id);
+struct omap_dss_output *omap_dss_find_output(const char *name);
 int omapdss_output_set_device(struct omap_dss_output *out,
 		struct omap_dss_device *dssdev);
 int omapdss_output_unset_device(struct omap_dss_output *out);