summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2017-07-12 08:49:14 +0300
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-09-01 02:10:12 +0300
commit340fd7bce08af00f97d07d5d09d1a9822379efec (patch)
treea789ec983801a389f40170477ccc20ea0dc38654 /drivers/rtc
parent79c676c4e31e7d31b5adfbac996dd167766cf4ab (diff)
downloadlinux-340fd7bce08af00f97d07d5d09d1a9822379efec.tar.xz
rtc: ds1307: remove member irq from struct ds1307
The irq number is used in the probe function only, so we don't have to store it in struct ds1307. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-ds1307.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 1cedb21ba792..adc90f188dae 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -126,7 +126,6 @@ struct ds1307 {
struct device *dev;
struct regmap *regmap;
const char *name;
- int irq;
struct rtc_device *rtc;
#ifdef CONFIG_COMMON_CLK
struct clk_hw clks[2];
@@ -1334,7 +1333,6 @@ static int ds1307_probe(struct i2c_client *client,
dev_set_drvdata(&client->dev, ds1307);
ds1307->dev = &client->dev;
ds1307->name = client->name;
- ds1307->irq = client->irq;
ds1307->regmap = devm_regmap_init_i2c(client, &regmap_config);
if (IS_ERR(ds1307->regmap)) {
@@ -1414,7 +1412,7 @@ static int ds1307_probe(struct i2c_client *client,
* For some variants, be sure alarms can trigger when we're
* running on Vbackup (BBSQI/BBSQW)
*/
- if (chip->alarm && (ds1307->irq > 0 ||
+ if (chip->alarm && (client->irq > 0 ||
ds1307_can_wakeup_device)) {
ds1307->regs[0] |= DS1337_BIT_INTCN
| bbsqi_bitpos[ds1307->type];
@@ -1499,7 +1497,7 @@ static int ds1307_probe(struct i2c_client *client,
case rx_8130:
ds1307->offset = 0x10; /* Seconds starts at 0x10 */
rtc_ops = &rx8130_rtc_ops;
- if (chip->alarm && ds1307->irq > 0) {
+ if (chip->alarm && client->irq > 0) {
irq_handler = rx8130_irq;
want_irq = true;
}
@@ -1509,7 +1507,7 @@ static int ds1307_probe(struct i2c_client *client,
break;
case mcp794xx:
rtc_ops = &mcp794xx_rtc_ops;
- if (chip->alarm && (ds1307->irq > 0 ||
+ if (chip->alarm && (client->irq > 0 ||
ds1307_can_wakeup_device)) {
irq_handler = mcp794xx_irq;
want_irq = true;
@@ -1655,7 +1653,7 @@ read_rtc:
return PTR_ERR(ds1307->rtc);
}
- if (ds1307_can_wakeup_device && ds1307->irq <= 0) {
+ if (ds1307_can_wakeup_device && client->irq <= 0) {
/* Disable request for an IRQ */
want_irq = false;
dev_info(ds1307->dev,
@@ -1666,7 +1664,7 @@ read_rtc:
if (want_irq) {
err = devm_request_threaded_irq(ds1307->dev,
- ds1307->irq, NULL, irq_handler,
+ client->irq, NULL, irq_handler,
IRQF_SHARED | IRQF_ONESHOT,
ds1307->name, ds1307);
if (err) {