All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Sebastian Reichel <sre@kernel.org>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH v2 07/17] smiapp: Always initialise the sensor in probe
Date: Tue, 20 Sep 2016 00:09:59 +0300	[thread overview]
Message-ID: <57E05427.1030800@linux.intel.com> (raw)
In-Reply-To: <20160919205925.myramm47julqwcxb@earth>

Sebastian Reichel wrote:
> Hi,
>
> On Thu, Sep 15, 2016 at 02:22:21PM +0300, Sakari Ailus wrote:
>> Initialise the sensor in probe. The reason why it wasn't previously done
>> in case of platform data was that the probe() of the driver that provided
>> the clock through the set_xclk() callback would need to finish before the
>> probe() function of the smiapp driver. The set_xclk() callback no longer
>> exists.
>>
>> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
>> ---
>>   drivers/media/i2c/smiapp/smiapp-core.c | 53 ++++++++++++----------------------
>>   1 file changed, 19 insertions(+), 34 deletions(-)
>>
>> diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
>> index 5d251b4..13322f3 100644
>> --- a/drivers/media/i2c/smiapp/smiapp-core.c
>> +++ b/drivers/media/i2c/smiapp/smiapp-core.c
>> @@ -2530,8 +2530,19 @@ static int smiapp_register_subdev(struct smiapp_sensor *sensor,
>>   	return 0;
>>   }
>>
>> -static int smiapp_register_subdevs(struct smiapp_sensor *sensor)
>> +static void smiapp_cleanup(struct smiapp_sensor *sensor)
>> +{
>> +	struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
>> +
>> +	device_remove_file(&client->dev, &dev_attr_nvm);
>> +	device_remove_file(&client->dev, &dev_attr_ident);
>> +
>> +	smiapp_free_controls(sensor);
>> +}
>> +
>> +static int smiapp_registered(struct v4l2_subdev *subdev)
>>   {
>> +	struct smiapp_sensor *sensor = to_smiapp_sensor(subdev);
>>   	int rval;
>>
>>   	if (sensor->scaler) {
>> @@ -2540,23 +2551,18 @@ static int smiapp_register_subdevs(struct smiapp_sensor *sensor)
>>   			SMIAPP_PAD_SRC, SMIAPP_PAD_SINK,
>>   			MEDIA_LNK_FL_ENABLED | MEDIA_LNK_FL_IMMUTABLE);
>>   		if (rval < 0)
>> -			return rval;
>> +			goto out_err;
>>   	}
>>
>>   	return smiapp_register_subdev(
>>   		sensor, sensor->pixel_array, sensor->binner,
>>   		SMIAPP_PA_PAD_SRC, SMIAPP_PAD_SINK,
>>   		MEDIA_LNK_FL_ENABLED | MEDIA_LNK_FL_IMMUTABLE);
>
> I guess you should also handle errors from the second
> smiapp_register_subdev call?

Um, yes. Perhaps it'd be better just fix it here now that we still 
remember the problem. :-) I'll fix that for v2.

>
>> -}
>>
>> -static void smiapp_cleanup(struct smiapp_sensor *sensor)
>> -{
>> -	struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
>> -
>> -	device_remove_file(&client->dev, &dev_attr_nvm);
>> -	device_remove_file(&client->dev, &dev_attr_ident);
>> +out_err:
>> +	smiapp_cleanup(sensor);
>>
>> -	smiapp_free_controls(sensor);
>> +	return rval;
>>   }
>
> -- Sebastian
>


-- 
Sakari Ailus
sakari.ailus@linux.intel.com

  reply	other threads:[~2016-09-19 21:10 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15 11:22 [PATCH v2 00/17] More smiapp cleanups, fixes Sakari Ailus
2016-09-15 11:22 ` [PATCH v2 01/17] smiapp: Move sub-device initialisation into a separate function Sakari Ailus
2016-09-19 20:11   ` Sebastian Reichel
2016-09-19 20:58     ` Sakari Ailus
2016-09-15 11:22 ` [PATCH v2 02/17] smiapp: Explicitly define number of pads in initialisation Sakari Ailus
2016-09-19 20:12   ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 03/17] smiapp: Initialise media entity after sensor init Sakari Ailus
2016-09-19 22:02   ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 04/17] smiapp: Split off sub-device registration into two Sakari Ailus
2016-09-19 20:30   ` Sebastian Reichel
2016-09-19 20:50     ` Sakari Ailus
2016-09-19 21:02       ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 05/17] smiapp: Provide a common function to obtain native pixel array size Sakari Ailus
2016-09-19 20:33   ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 06/17] smiapp: Remove unnecessary BUG_ON()'s Sakari Ailus
2016-09-19 20:39   ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 07/17] smiapp: Always initialise the sensor in probe Sakari Ailus
2016-09-19 20:59   ` Sebastian Reichel
2016-09-19 21:09     ` Sakari Ailus [this message]
2016-09-15 11:22 ` [PATCH v2 08/17] smiapp: Merge smiapp_init() with smiapp_probe() Sakari Ailus
2016-09-19 21:09   ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 09/17] smiapp: Read frame format earlier Sakari Ailus
2016-09-19 21:14   ` Sebastian Reichel
2016-09-19 21:19     ` Sakari Ailus
2016-09-19 21:23       ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 10/17] smiapp: Unify setting up sub-devices Sakari Ailus
2016-09-19 21:16   ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 11/17] smiapp: Use SMIAPP_PADS when referring to number of pads Sakari Ailus
2016-09-19 21:16   ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 12/17] smiapp: Obtain frame layout from the frame descriptor Sakari Ailus
2016-09-19 21:21   ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 13/17] smiapp: Improve debug messages from frame layout reading Sakari Ailus
2016-09-19 21:28   ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 14/17] smiapp: Remove useless newlines and other small cleanups Sakari Ailus
2016-09-19 21:30   ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 15/17] smiapp: Obtain correct media bus code for try format Sakari Ailus
2016-09-19 21:33   ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 16/17] smiapp: Drop a debug print on frame size and bit depth Sakari Ailus
2016-09-19 21:39   ` Sebastian Reichel
2016-09-15 11:22 ` [PATCH v2 17/17] smiapp-pll: Don't complain aloud about failing PLL calculation Sakari Ailus
2016-09-19 21:48   ` Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57E05427.1030800@linux.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.