Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1314279 > unrolled thread
| Started by | Thierry Reding <treding@nvidia.com> |
|---|---|
| First post | 2016-01-21 16:40 +0100 |
| Last post | 2016-01-26 16:00 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH v4 1/6] drm/dsi: check for CONFIG_OF when defining of_mipi_dsi_device_add Thierry Reding <treding@nvidia.com> - 2016-01-21 16:40 +0100
Re: [PATCH v4 1/6] drm/dsi: check for CONFIG_OF when defining of_mipi_dsi_device_add Archit Taneja <architt@codeaurora.org> - 2016-01-26 16:00 +0100
| From | Thierry Reding <treding@nvidia.com> |
|---|---|
| Date | 2016-01-21 16:40 +0100 |
| Subject | Re: [PATCH v4 1/6] drm/dsi: check for CONFIG_OF when defining of_mipi_dsi_device_add |
| Message-ID | <qTpv5-7aA-31@gated-at.bofh.it> |
[Multipart message — attachments visible in raw view] — view raw
On Thu, Dec 10, 2015 at 06:11:35PM +0530, Archit Taneja wrote:
> of_mipi_dsi_device_add is used only when CONFIG_OF is enabled. It
> currently works if OF support is disabled, but this will change
> when we add more functionality to it.
>
> Define the original func if CONFIG_OF is enabled. Define a dummy func
> otherwise.
>
> Signed-off-by: Archit Taneja <architt@codeaurora.org>
> ---
> drivers/gpu/drm/drm_mipi_dsi.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
> index 2d5ca8ee..bced235 100644
> --- a/drivers/gpu/drm/drm_mipi_dsi.c
> +++ b/drivers/gpu/drm/drm_mipi_dsi.c
> @@ -129,6 +129,7 @@ static int mipi_dsi_device_add(struct mipi_dsi_device *dsi)
> return device_add(&dsi->dev);
> }
>
> +#if IS_ENABLED(CONFIG_OF)
> static struct mipi_dsi_device *
> of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *node)
> {
> @@ -170,6 +171,13 @@ of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *node)
>
> return dsi;
> }
> +#else
> +static struct mipi_dsi_device *
> +of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *node)
> +{
> + return NULL;
> +}
> +#endif
The OF implementation of this function never returns NULL, so perhaps
this should return an ERR_PTR()-encoded error code instead? This isn't
really important because we never check the return value in the one
call-site that we have, which I guess could be an argument for removing
the return value altogether...
Thierry
[toc] | [next] | [standalone]
| From | Archit Taneja <architt@codeaurora.org> |
|---|---|
| Date | 2016-01-26 16:00 +0100 |
| Message-ID | <qVdg7-5z6-31@gated-at.bofh.it> |
| In reply to | #1314279 |
On 1/21/2016 9:01 PM, Thierry Reding wrote:
> On Thu, Dec 10, 2015 at 06:11:35PM +0530, Archit Taneja wrote:
>> of_mipi_dsi_device_add is used only when CONFIG_OF is enabled. It
>> currently works if OF support is disabled, but this will change
>> when we add more functionality to it.
>>
>> Define the original func if CONFIG_OF is enabled. Define a dummy func
>> otherwise.
>>
>> Signed-off-by: Archit Taneja <architt@codeaurora.org>
>> ---
>> drivers/gpu/drm/drm_mipi_dsi.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
>> index 2d5ca8ee..bced235 100644
>> --- a/drivers/gpu/drm/drm_mipi_dsi.c
>> +++ b/drivers/gpu/drm/drm_mipi_dsi.c
>> @@ -129,6 +129,7 @@ static int mipi_dsi_device_add(struct mipi_dsi_device *dsi)
>> return device_add(&dsi->dev);
>> }
>>
>> +#if IS_ENABLED(CONFIG_OF)
>> static struct mipi_dsi_device *
>> of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *node)
>> {
>> @@ -170,6 +171,13 @@ of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *node)
>>
>> return dsi;
>> }
>> +#else
>> +static struct mipi_dsi_device *
>> +of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *node)
>> +{
>> + return NULL;
>> +}
>> +#endif
>
> The OF implementation of this function never returns NULL, so perhaps
> this should return an ERR_PTR()-encoded error code instead? This isn't
> really important because we never check the return value in the one
> call-site that we have, which I guess could be an argument for removing
> the return value altogether...
You're right. I'll replace this with ERR_PTR(-ENODEV). Maybe we could
keep the return value in case we use it in the future.
Thanks,
Archit
>
> Thierry
>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web