[1/3] omap3isp: Defer probing when subdev isn't available

Message ID 1426015494-16799-2-git-send-email-tim.nordell@logicpd.com (mailing list archive)
State Obsoleted, archived
Delegated to: Laurent Pinchart
Headers

Commit Message

Tim Nordell March 10, 2015, 7:24 p.m. UTC
  If the subdev isn't available just yet, defer probing of
the system.  This is useful if the omap3isp comes up before
the I2C subsystem does.

Signed-off-by: Tim Nordell <tim.nordell@logicpd.com>
---
 drivers/media/platform/omap3isp/isp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Comments

Laurent Pinchart March 18, 2015, 3:15 p.m. UTC | #1
Hi Tim,

Thank you for the patch.

The OMAP3 ISP driver is moving to DT, hopefully in time for v4.1. See "[PATCH 
00/15] omap3isp driver DT support" posted to the list on Monday. I'd rather go 
for proper DT support instead of custom deferred probing.

On Tuesday 10 March 2015 14:24:52 Tim Nordell wrote:
> If the subdev isn't available just yet, defer probing of
> the system.  This is useful if the omap3isp comes up before
> the I2C subsystem does.
> 
> Signed-off-by: Tim Nordell <tim.nordell@logicpd.com>
> ---
>  drivers/media/platform/omap3isp/isp.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/omap3isp/isp.c
> b/drivers/media/platform/omap3isp/isp.c index 51c2129..a361c40 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
> @@ -1811,7 +1811,7 @@ isp_register_subdev_group(struct isp_device *isp,
>  				"device %s\n", __func__,
>  				board_info->i2c_adapter_id,
>  				board_info->board_info->type);
> -			continue;
> +			return ERR_PTR(-EPROBE_DEFER);
>  		}
> 
>  		subdev = v4l2_i2c_new_subdev_board(&isp->v4l2_dev, adapter,
> @@ -1898,6 +1898,10 @@ static int isp_register_entities(struct isp_device
> *isp) unsigned int i;
> 
>  		sensor = isp_register_subdev_group(isp, subdevs->subdevs);
> +		if (IS_ERR(sensor)) {
> +			ret = PTR_ERR(sensor);
> +			goto done;
> +		}
>  		if (sensor == NULL)
>  			continue;
  
Tim Nordell March 18, 2015, 3:18 p.m. UTC | #2
Laurent -

Agreed.  This is a stop gap for this, but I guess by the time this patch 
could possibly get incorporated we'd be off to device tree anyways.

- Tim

(Sorry for the repeat - my e-mail client sent out an HTML message so it 
didn't get through to the mailing list.)

On 03/18/15 10:15, Laurent Pinchart wrote:
> Hi Tim,
>
> Thank you for the patch.
>
> The OMAP3 ISP driver is moving to DT, hopefully in time for v4.1. See "[PATCH
> 00/15] omap3isp driver DT support" posted to the list on Monday. I'd rather go
> for proper DT support instead of custom deferred probing.
>
> On Tuesday 10 March 2015 14:24:52 Tim Nordell wrote:
>> If the subdev isn't available just yet, defer probing of
>> the system.  This is useful if the omap3isp comes up before
>> the I2C subsystem does.
>>
>> Signed-off-by: Tim Nordell <tim.nordell@logicpd.com>
>> ---
>>   drivers/media/platform/omap3isp/isp.c | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/platform/omap3isp/isp.c
>> b/drivers/media/platform/omap3isp/isp.c index 51c2129..a361c40 100644
>> --- a/drivers/media/platform/omap3isp/isp.c
>> +++ b/drivers/media/platform/omap3isp/isp.c
>> @@ -1811,7 +1811,7 @@ isp_register_subdev_group(struct isp_device *isp,
>>   				"device %s\n", __func__,
>>   				board_info->i2c_adapter_id,
>>   				board_info->board_info->type);
>> -			continue;
>> +			return ERR_PTR(-EPROBE_DEFER);
>>   		}
>>
>>   		subdev = v4l2_i2c_new_subdev_board(&isp->v4l2_dev, adapter,
>> @@ -1898,6 +1898,10 @@ static int isp_register_entities(struct isp_device
>> *isp) unsigned int i;
>>
>>   		sensor = isp_register_subdev_group(isp, subdevs->subdevs);
>> +		if (IS_ERR(sensor)) {
>> +			ret = PTR_ERR(sensor);
>> +			goto done;
>> +		}
>>   		if (sensor == NULL)
>>   			continue;
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 51c2129..a361c40 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -1811,7 +1811,7 @@  isp_register_subdev_group(struct isp_device *isp,
 				"device %s\n", __func__,
 				board_info->i2c_adapter_id,
 				board_info->board_info->type);
-			continue;
+			return ERR_PTR(-EPROBE_DEFER);
 		}
 
 		subdev = v4l2_i2c_new_subdev_board(&isp->v4l2_dev, adapter,
@@ -1898,6 +1898,10 @@  static int isp_register_entities(struct isp_device *isp)
 		unsigned int i;
 
 		sensor = isp_register_subdev_group(isp, subdevs->subdevs);
+		if (IS_ERR(sensor)) {
+			ret = PTR_ERR(sensor);
+			goto done;
+		}
 		if (sensor == NULL)
 			continue;