Skip to content

Commit

Permalink
drivers/rtc/rtc-ds1307.c: fix sysfs wakealarm attribute creation
Browse files Browse the repository at this point in the history
In order to allow the creation of the sysfs attribute wakealarm, this
patch moves the device_set_wakeup_capable() call above the RTC device
registration.

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Gregory Clement <gregory.clement@free-electrons.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Simon Guinot authored and Linus Torvalds committed Apr 3, 2014
1 parent 3916b09 commit 5ea7351
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-ds1307.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,7 @@ static int ds1307_probe(struct i2c_client *client,
bin2bcd(tmp));
}

device_set_wakeup_capable(&client->dev, want_irq);
ds1307->rtc = devm_rtc_device_register(&client->dev, client->name,
&ds13xx_rtc_ops, THIS_MODULE);
if (IS_ERR(ds1307->rtc)) {
Expand All @@ -941,7 +942,6 @@ static int ds1307_probe(struct i2c_client *client,
dev_err(&client->dev, "unable to request IRQ!\n");
} else {

device_set_wakeup_capable(&client->dev, 1);
set_bit(HAS_ALARM, &ds1307->flags);
dev_dbg(&client->dev, "got IRQ %d\n", client->irq);
}
Expand Down

0 comments on commit 5ea7351

Please sign in to comment.