Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 736db646 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

[media] m5mols: Convert to devm_request_irq()



Using the managed function the free_irq() calls can be removed from the
probe error path and the remove handler.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 07e0e5b2
Loading
Loading
Loading
Loading
+5 −9
Original line number Original line Diff line number Diff line
@@ -988,11 +988,11 @@ static int m5mols_probe(struct i2c_client *client,
	init_waitqueue_head(&info->irq_waitq);
	init_waitqueue_head(&info->irq_waitq);
	mutex_init(&info->lock);
	mutex_init(&info->lock);


	ret = request_irq(client->irq, m5mols_irq_handler,
	ret = devm_request_irq(&client->dev, client->irq, m5mols_irq_handler,
			       IRQF_TRIGGER_RISING, MODULE_NAME, sd);
			       IRQF_TRIGGER_RISING, MODULE_NAME, sd);
	if (ret) {
	if (ret) {
		dev_err(&client->dev, "Interrupt request failed: %d\n", ret);
		dev_err(&client->dev, "Interrupt request failed: %d\n", ret);
		goto out_me;
		goto error;
	}
	}
	info->res_type = M5MOLS_RESTYPE_MONITOR;
	info->res_type = M5MOLS_RESTYPE_MONITOR;
	info->ffmt[0] = m5mols_default_ffmt[0];
	info->ffmt[0] = m5mols_default_ffmt[0];
@@ -1000,7 +1000,7 @@ static int m5mols_probe(struct i2c_client *client,


	ret = m5mols_sensor_power(info, true);
	ret = m5mols_sensor_power(info, true);
	if (ret)
	if (ret)
		goto out_irq;
		goto error;


	ret = m5mols_fw_start(sd);
	ret = m5mols_fw_start(sd);
	if (!ret)
	if (!ret)
@@ -1009,9 +1009,7 @@ static int m5mols_probe(struct i2c_client *client,
	ret = m5mols_sensor_power(info, false);
	ret = m5mols_sensor_power(info, false);
	if (!ret)
	if (!ret)
		return 0;
		return 0;
out_irq:
error:
	free_irq(client->irq, sd);
out_me:
	media_entity_cleanup(&sd->entity);
	media_entity_cleanup(&sd->entity);
	return ret;
	return ret;
}
}
@@ -1022,8 +1020,6 @@ static int m5mols_remove(struct i2c_client *client)


	v4l2_device_unregister_subdev(sd);
	v4l2_device_unregister_subdev(sd);
	v4l2_ctrl_handler_free(sd->ctrl_handler);
	v4l2_ctrl_handler_free(sd->ctrl_handler);
	free_irq(client->irq, sd);

	media_entity_cleanup(&sd->entity);
	media_entity_cleanup(&sd->entity);


	return 0;
	return 0;