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

Commit c5983191 authored by Nishanth Menon's avatar Nishanth Menon Committed by Alexandre Belloni
Browse files

rtc: ds1307: Switch to managed irq allocation



Since we are not doing anything fancy in remove function that requires
us to sequence IRQ free operation, we might as well switch over to devm_
equivalent of managed IRQ allocation and remove the explicit free_irq
since it'd be done automatically at remove.

Signed-off-by: default avatarNishanth Menon <nm@ti.com>
Acked-by: default avatarFelipe Balbi <balbi@ti.com>
Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent 2fb07a10
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -1156,7 +1156,8 @@ static int ds1307_probe(struct i2c_client *client,
	}

	if (want_irq) {
		err = request_threaded_irq(client->irq, NULL, irq_handler,
		err = devm_request_threaded_irq(&client->dev,
						client->irq, NULL, irq_handler,
						IRQF_SHARED | IRQF_ONESHOT,
						ds1307->rtc->name, client);
		if (err) {
@@ -1212,9 +1213,6 @@ static int ds1307_remove(struct i2c_client *client)
{
	struct ds1307 *ds1307 = i2c_get_clientdata(client);

	if (test_and_clear_bit(HAS_ALARM, &ds1307->flags))
		free_irq(client->irq, client);

	if (test_and_clear_bit(HAS_NVRAM, &ds1307->flags))
		sysfs_remove_bin_file(&client->dev.kobj, ds1307->nvram);