All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: bingbu.cao@intel.com
Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	tfiga@google.com, jacopo@jmondi.org, rajmohan.mani@intel.com,
	bingbu.cao@linux.intel.com, tian.shu.qiu@intel.com,
	jian.xu.zheng@intel.com
Subject: Re: [PATCH v5 2/2] media: ak7375: Add ak7375 lens voice coil driver
Date: Thu, 21 Jun 2018 14:25:16 +0300	[thread overview]
Message-ID: <20180621112516.mwlph7u6et65gbh6@paasikivi.fi.intel.com> (raw)
In-Reply-To: <1529388107-14308-2-git-send-email-bingbu.cao@intel.com>

On Tue, Jun 19, 2018 at 02:01:47PM +0800, bingbu.cao@intel.com wrote:
> +static int ak7375_probe(struct i2c_client *client)
> +{
> +	struct ak7375_device *ak7375_dev;
> +	int val;
> +
> +	ak7375_dev = devm_kzalloc(&client->dev, sizeof(*ak7375_dev),
> +				  GFP_KERNEL);
> +	if (!ak7375_dev)
> +		return -ENOMEM;
> +
> +	v4l2_i2c_subdev_init(&ak7375_dev->sd, client, &ak7375_ops);
> +	ak7375_dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
> +	ak7375_dev->sd.internal_ops = &ak7375_int_ops;
> +	ak7375_dev->sd.entity.function = MEDIA_ENT_F_LENS;
> +
> +	val = ak7375_init_controls(ak7375_dev);
> +	if (val)
> +		goto err_cleanup;
> +
> +	val = media_entity_pads_init(&ak7375_dev->sd.entity, 0, NULL);
> +	if (val < 0)
> +		goto err_cleanup;
> +
> +	val = v4l2_async_register_subdev(&ak7375_dev->sd);
> +	if (val < 0)
> +		goto err_cleanup;
> +
> +	pm_runtime_set_active(&client->dev);
> +	pm_runtime_enable(&client->dev);
> +	pm_runtime_idle(&client->dev);
> +
> +	return 0;
> +
> +err_cleanup:
> +	v4l2_ctrl_handler_free(&ak7375_dev->ctrls_vcm);
> +	media_entity_cleanup(&ak7375_dev->sd.entity);
> +	dev_err(&client->dev, "Probe failed: %d\n", val);

This line is redundant, too: the kernel already prints the error value.

> +
> +	return val;
> +}

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

  parent reply	other threads:[~2018-06-21 11:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19  6:01 [PATCH v5 1/2] dt-bindings: Add bindings for AKM ak7375 voice coil lens bingbu.cao
2018-06-19  6:01 ` [PATCH v5 2/2] media: ak7375: Add ak7375 lens voice coil driver bingbu.cao
2018-06-21 11:23   ` Sakari Ailus
2018-06-22  3:08     ` Bing Bu Cao
2018-06-21 11:25   ` Sakari Ailus [this message]
2018-06-22  3:11     ` Bing Bu Cao

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=20180621112516.mwlph7u6et65gbh6@paasikivi.fi.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=bingbu.cao@intel.com \
    --cc=bingbu.cao@linux.intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jacopo@jmondi.org \
    --cc=jian.xu.zheng@intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=rajmohan.mani@intel.com \
    --cc=tfiga@google.com \
    --cc=tian.shu.qiu@intel.com \
    /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.