On Tue, Jun 19, 2018 at 02:01:47PM +0800, bingbu.cao@xxxxxxxxx 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@xxxxxxxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html