mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 23:00:21 +00:00
[media] si4713: use managed irq request
Introduce the usage of managed irq request to simplify the code slightly. Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
80cd5c7a4e
commit
c3a5baf452
@ -1589,7 +1589,7 @@ static int si4713_probe(struct i2c_client *client,
|
|||||||
sdev->sd.ctrl_handler = hdl;
|
sdev->sd.ctrl_handler = hdl;
|
||||||
|
|
||||||
if (client->irq) {
|
if (client->irq) {
|
||||||
rval = request_irq(client->irq,
|
rval = devm_request_irq(&client->dev, client->irq,
|
||||||
si4713_handler, IRQF_TRIGGER_FALLING,
|
si4713_handler, IRQF_TRIGGER_FALLING,
|
||||||
client->name, sdev);
|
client->name, sdev);
|
||||||
if (rval < 0) {
|
if (rval < 0) {
|
||||||
@ -1604,14 +1604,11 @@ static int si4713_probe(struct i2c_client *client,
|
|||||||
rval = si4713_initialize(sdev);
|
rval = si4713_initialize(sdev);
|
||||||
if (rval < 0) {
|
if (rval < 0) {
|
||||||
v4l2_err(&sdev->sd, "Failed to probe device information.\n");
|
v4l2_err(&sdev->sd, "Failed to probe device information.\n");
|
||||||
goto free_irq;
|
goto free_ctrls;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
free_irq:
|
|
||||||
if (client->irq)
|
|
||||||
free_irq(client->irq, sdev);
|
|
||||||
free_ctrls:
|
free_ctrls:
|
||||||
v4l2_ctrl_handler_free(hdl);
|
v4l2_ctrl_handler_free(hdl);
|
||||||
exit:
|
exit:
|
||||||
@ -1627,9 +1624,6 @@ static int si4713_remove(struct i2c_client *client)
|
|||||||
if (sdev->power_state)
|
if (sdev->power_state)
|
||||||
si4713_set_power_state(sdev, POWER_DOWN);
|
si4713_set_power_state(sdev, POWER_DOWN);
|
||||||
|
|
||||||
if (client->irq > 0)
|
|
||||||
free_irq(client->irq, sdev);
|
|
||||||
|
|
||||||
v4l2_device_unregister_subdev(sd);
|
v4l2_device_unregister_subdev(sd);
|
||||||
v4l2_ctrl_handler_free(sd->ctrl_handler);
|
v4l2_ctrl_handler_free(sd->ctrl_handler);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user