Skip to content

Commit 8c28c49

Browse files
Wolfram Sangalexandrebelloni
authored andcommitted
rtc: use boolean values with device_init_wakeup()
device_init_wakeup() second argument is a bool type. Use proper boolean values when calling it to match the type and to produce unambiguous code which is easier to understand. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Charles Keepax <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 7158c61 commit 8c28c49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+62
-62
lines changed

drivers/rtc/rtc-88pm80x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ static int pm80x_rtc_probe(struct platform_device *pdev)
308308
/* remember whether this power up is caused by PMIC RTC or not */
309309
info->rtc_dev->dev.platform_data = &pdata->rtc_wakeup;
310310

311-
device_init_wakeup(&pdev->dev, 1);
311+
device_init_wakeup(&pdev->dev, true);
312312

313313
return 0;
314314
out_rtc:

drivers/rtc/rtc-88pm860x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ static int pm860x_rtc_probe(struct platform_device *pdev)
326326
schedule_delayed_work(&info->calib_work, VRTC_CALIB_INTERVAL);
327327
#endif /* VRTC_CALIBRATION */
328328

329-
device_init_wakeup(&pdev->dev, 1);
329+
device_init_wakeup(&pdev->dev, true);
330330

331331
return 0;
332332
}

drivers/rtc/rtc-amlogic-a4.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static int aml_rtc_probe(struct platform_device *pdev)
361361
"failed to get_enable rtc sys clk\n");
362362
aml_rtc_init(rtc);
363363

364-
device_init_wakeup(dev, 1);
364+
device_init_wakeup(dev, true);
365365
platform_set_drvdata(pdev, rtc);
366366

367367
rtc->rtc_dev = devm_rtc_allocate_device(dev);
@@ -391,7 +391,7 @@ static int aml_rtc_probe(struct platform_device *pdev)
391391
return 0;
392392
err_clk:
393393
clk_disable_unprepare(rtc->sys_clk);
394-
device_init_wakeup(dev, 0);
394+
device_init_wakeup(dev, false);
395395

396396
return ret;
397397
}
@@ -426,7 +426,7 @@ static void aml_rtc_remove(struct platform_device *pdev)
426426
struct aml_rtc_data *rtc = dev_get_drvdata(&pdev->dev);
427427

428428
clk_disable_unprepare(rtc->sys_clk);
429-
device_init_wakeup(&pdev->dev, 0);
429+
device_init_wakeup(&pdev->dev, false);
430430
}
431431

432432
static const struct aml_rtc_config a5_rtc_config = {

drivers/rtc/rtc-armada38x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ static __init int armada38x_rtc_probe(struct platform_device *pdev)
527527
platform_set_drvdata(pdev, rtc);
528528

529529
if (rtc->irq != -1)
530-
device_init_wakeup(&pdev->dev, 1);
530+
device_init_wakeup(&pdev->dev, true);
531531
else
532532
clear_bit(RTC_FEATURE_ALARM, rtc->rtc_dev->features);
533533

drivers/rtc/rtc-as3722.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static int as3722_rtc_probe(struct platform_device *pdev)
187187
return ret;
188188
}
189189

190-
device_init_wakeup(&pdev->dev, 1);
190+
device_init_wakeup(&pdev->dev, true);
191191

192192
as3722_rtc->rtc = devm_rtc_device_register(&pdev->dev, "as3722-rtc",
193193
&as3722_rtc_ops, THIS_MODULE);

drivers/rtc/rtc-at91rm9200.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
528528
* being wake-capable; if it didn't, do that here.
529529
*/
530530
if (!device_can_wakeup(&pdev->dev))
531-
device_init_wakeup(&pdev->dev, 1);
531+
device_init_wakeup(&pdev->dev, true);
532532

533533
if (at91_rtc_config->has_correction)
534534
rtc->ops = &sama5d4_rtc_ops;

drivers/rtc/rtc-at91sam9.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static int at91_rtc_probe(struct platform_device *pdev)
353353

354354
/* platform setup code should have handled this; sigh */
355355
if (!device_can_wakeup(&pdev->dev))
356-
device_init_wakeup(&pdev->dev, 1);
356+
device_init_wakeup(&pdev->dev, true);
357357

358358
platform_set_drvdata(pdev, rtc);
359359

drivers/rtc/rtc-cadence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static void cdns_rtc_remove(struct platform_device *pdev)
359359
struct cdns_rtc *crtc = platform_get_drvdata(pdev);
360360

361361
cdns_rtc_alarm_irq_enable(&pdev->dev, 0);
362-
device_init_wakeup(&pdev->dev, 0);
362+
device_init_wakeup(&pdev->dev, false);
363363

364364
clk_disable_unprepare(crtc->pclk);
365365
clk_disable_unprepare(crtc->ref_clk);

drivers/rtc/rtc-cmos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ static void acpi_cmos_wake_setup(struct device *dev)
864864
dev_info(dev, "RTC can wake from S4\n");
865865

866866
/* RTC always wakes from S1/S2/S3, and often S4/STD */
867-
device_init_wakeup(dev, 1);
867+
device_init_wakeup(dev, true);
868868
}
869869

870870
static void cmos_check_acpi_rtc_status(struct device *dev,

drivers/rtc/rtc-cpcap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static int cpcap_rtc_probe(struct platform_device *pdev)
295295
}
296296
disable_irq(rtc->update_irq);
297297

298-
err = device_init_wakeup(dev, 1);
298+
err = device_init_wakeup(dev, true);
299299
if (err) {
300300
dev_err(dev, "wakeup initialization failed (%d)\n", err);
301301
/* ignore error and continue without wakeup support */

drivers/rtc/rtc-cros-ec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static int cros_ec_rtc_probe(struct platform_device *pdev)
337337
return ret;
338338
}
339339

340-
ret = device_init_wakeup(&pdev->dev, 1);
340+
ret = device_init_wakeup(&pdev->dev, true);
341341
if (ret) {
342342
dev_err(&pdev->dev, "failed to initialize wakeup\n");
343343
return ret;

drivers/rtc/rtc-da9055.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static int da9055_rtc_probe(struct platform_device *pdev)
288288
if (ret & DA9055_RTC_ALM_EN)
289289
rtc->alarm_enable = 1;
290290

291-
device_init_wakeup(&pdev->dev, 1);
291+
device_init_wakeup(&pdev->dev, true);
292292

293293
rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
294294
&da9055_rtc_ops, THIS_MODULE);

drivers/rtc/rtc-ds3232.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ static int ds3232_probe(struct device *dev, struct regmap *regmap, int irq,
508508
return ret;
509509

510510
if (ds3232->irq > 0)
511-
device_init_wakeup(dev, 1);
511+
device_init_wakeup(dev, true);
512512

513513
ds3232_hwmon_register(dev, name);
514514

drivers/rtc/rtc-isl1208.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ static int isl1208_setup_irq(struct i2c_client *client, int irq)
830830
isl1208_driver.driver.name,
831831
client);
832832
if (!rc) {
833-
device_init_wakeup(&client->dev, 1);
833+
device_init_wakeup(&client->dev, true);
834834
enable_irq_wake(irq);
835835
} else {
836836
dev_err(&client->dev,

drivers/rtc/rtc-jz4740.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ static int jz4740_rtc_probe(struct platform_device *pdev)
367367

368368
platform_set_drvdata(pdev, rtc);
369369

370-
device_init_wakeup(dev, 1);
370+
device_init_wakeup(dev, true);
371371

372372
ret = dev_pm_set_wake_irq(dev, irq);
373373
if (ret)

drivers/rtc/rtc-loongson.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ static int loongson_rtc_probe(struct platform_device *pdev)
329329
alarm_irq);
330330

331331
priv->pm_base = regs - priv->config->pm_offset;
332-
device_init_wakeup(dev, 1);
332+
device_init_wakeup(dev, true);
333333

334334
if (has_acpi_companion(dev))
335335
acpi_install_fixed_event_handler(ACPI_EVENT_RTC,
@@ -360,7 +360,7 @@ static void loongson_rtc_remove(struct platform_device *pdev)
360360
acpi_remove_fixed_event_handler(ACPI_EVENT_RTC,
361361
loongson_rtc_handler);
362362

363-
device_init_wakeup(dev, 0);
363+
device_init_wakeup(dev, false);
364364
loongson_rtc_alarm_irq_enable(dev, 0);
365365
}
366366

drivers/rtc/rtc-lp8788.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static int lp8788_rtc_probe(struct platform_device *pdev)
293293
rtc->alarm = lp->pdata ? lp->pdata->alarm_sel : DEFAULT_ALARM_SEL;
294294
platform_set_drvdata(pdev, rtc);
295295

296-
device_init_wakeup(dev, 1);
296+
device_init_wakeup(dev, true);
297297

298298
rtc->rdev = devm_rtc_device_register(dev, "lp8788_rtc",
299299
&lp8788_rtc_ops, THIS_MODULE);

drivers/rtc/rtc-lpc32xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static int lpc32xx_rtc_probe(struct platform_device *pdev)
257257
dev_warn(&pdev->dev, "Can't request interrupt.\n");
258258
rtc->irq = -1;
259259
} else {
260-
device_init_wakeup(&pdev->dev, 1);
260+
device_init_wakeup(&pdev->dev, true);
261261
}
262262
}
263263

drivers/rtc/rtc-max77686.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ static int max77686_rtc_probe(struct platform_device *pdev)
770770
goto err_rtc;
771771
}
772772

773-
device_init_wakeup(&pdev->dev, 1);
773+
device_init_wakeup(&pdev->dev, true);
774774

775775
info->rtc_dev = devm_rtc_device_register(&pdev->dev, id->name,
776776
&max77686_rtc_ops, THIS_MODULE);

drivers/rtc/rtc-max8925.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static int max8925_rtc_probe(struct platform_device *pdev)
270270
/* XXX - isn't this redundant? */
271271
platform_set_drvdata(pdev, info);
272272

273-
device_init_wakeup(&pdev->dev, 1);
273+
device_init_wakeup(&pdev->dev, true);
274274

275275
info->rtc_dev = devm_rtc_device_register(&pdev->dev, "max8925-rtc",
276276
&max8925_rtc_ops, THIS_MODULE);

drivers/rtc/rtc-max8997.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ static int max8997_rtc_probe(struct platform_device *pdev)
473473
max8997_rtc_enable_wtsr(info, true);
474474
max8997_rtc_enable_smpl(info, true);
475475

476-
device_init_wakeup(&pdev->dev, 1);
476+
device_init_wakeup(&pdev->dev, true);
477477

478478
info->rtc_dev = devm_rtc_device_register(&pdev->dev, "max8997-rtc",
479479
&max8997_rtc_ops, THIS_MODULE);

drivers/rtc/rtc-meson-vrtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static int meson_vrtc_probe(struct platform_device *pdev)
7474
if (IS_ERR(vrtc->io_alarm))
7575
return PTR_ERR(vrtc->io_alarm);
7676

77-
device_init_wakeup(&pdev->dev, 1);
77+
device_init_wakeup(&pdev->dev, true);
7878

7979
platform_set_drvdata(pdev, vrtc);
8080

drivers/rtc/rtc-mpc5121.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static int mpc5121_rtc_probe(struct platform_device *op)
303303
return PTR_ERR(rtc->regs);
304304
}
305305

306-
device_init_wakeup(&op->dev, 1);
306+
device_init_wakeup(&op->dev, true);
307307

308308
platform_set_drvdata(op, rtc);
309309

drivers/rtc/rtc-mt6397.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
286286
return ret;
287287
}
288288

289-
device_init_wakeup(&pdev->dev, 1);
289+
device_init_wakeup(&pdev->dev, true);
290290

291291
rtc->rtc_dev->ops = &mtk_rtc_ops;
292292
rtc->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_1900;

drivers/rtc/rtc-mv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
264264
}
265265

266266
if (pdata->irq >= 0)
267-
device_init_wakeup(&pdev->dev, 1);
267+
device_init_wakeup(&pdev->dev, true);
268268
else
269269
clear_bit(RTC_FEATURE_ALARM, pdata->rtc->features);
270270

@@ -287,7 +287,7 @@ static void __exit mv_rtc_remove(struct platform_device *pdev)
287287
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
288288

289289
if (pdata->irq >= 0)
290-
device_init_wakeup(&pdev->dev, 0);
290+
device_init_wakeup(&pdev->dev, false);
291291

292292
if (!IS_ERR(pdata->clk))
293293
clk_disable_unprepare(pdata->clk);

drivers/rtc/rtc-mxc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
377377
}
378378

379379
if (pdata->irq >= 0) {
380-
device_init_wakeup(&pdev->dev, 1);
380+
device_init_wakeup(&pdev->dev, true);
381381
ret = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
382382
if (ret)
383383
dev_err(&pdev->dev, "failed to enable irq wake\n");

drivers/rtc/rtc-mxc_v2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
302302
if (pdata->irq < 0)
303303
return pdata->irq;
304304

305-
device_init_wakeup(&pdev->dev, 1);
305+
device_init_wakeup(&pdev->dev, true);
306306
ret = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
307307
if (ret)
308308
dev_err(&pdev->dev, "failed to enable irq wake\n");

drivers/rtc/rtc-omap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ static void omap_rtc_remove(struct platform_device *pdev)
920920
omap_rtc_power_off_rtc = NULL;
921921
}
922922

923-
device_init_wakeup(&pdev->dev, 0);
923+
device_init_wakeup(&pdev->dev, false);
924924

925925
if (!IS_ERR(rtc->clk))
926926
clk_disable_unprepare(rtc->clk);

drivers/rtc/rtc-palmas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static int palmas_rtc_probe(struct platform_device *pdev)
287287

288288
palmas_rtc->irq = platform_get_irq(pdev, 0);
289289

290-
device_init_wakeup(&pdev->dev, 1);
290+
device_init_wakeup(&pdev->dev, true);
291291
palmas_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
292292
&palmas_rtc_ops, THIS_MODULE);
293293
if (IS_ERR(palmas_rtc->rtc)) {

drivers/rtc/rtc-pic32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ static int pic32_rtc_probe(struct platform_device *pdev)
330330

331331
pic32_rtc_enable(pdata, 1);
332332

333-
device_init_wakeup(&pdev->dev, 1);
333+
device_init_wakeup(&pdev->dev, true);
334334

335335
pdata->rtc->ops = &pic32_rtcops;
336336
pdata->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;

drivers/rtc/rtc-pm8xxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev)
503503

504504
platform_set_drvdata(pdev, rtc_dd);
505505

506-
device_init_wakeup(&pdev->dev, 1);
506+
device_init_wakeup(&pdev->dev, true);
507507

508508
rtc_dd->rtc = devm_rtc_allocate_device(&pdev->dev);
509509
if (IS_ERR(rtc_dd->rtc))

drivers/rtc/rtc-pxa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ static int __init pxa_rtc_probe(struct platform_device *pdev)
360360
return ret;
361361
}
362362

363-
device_init_wakeup(dev, 1);
363+
device_init_wakeup(dev, true);
364364

365365
return 0;
366366
}

drivers/rtc/rtc-rc5t583.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static int rc5t583_rtc_probe(struct platform_device *pdev)
245245
dev_err(&pdev->dev, "IRQ is not free.\n");
246246
return ret;
247247
}
248-
device_init_wakeup(&pdev->dev, 1);
248+
device_init_wakeup(&pdev->dev, true);
249249

250250
ricoh_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
251251
&rc5t583_rtc_ops, THIS_MODULE);

drivers/rtc/rtc-rc5t619.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ static int rc5t619_rtc_probe(struct platform_device *pdev)
414414

415415
} else {
416416
/* enable wake */
417-
device_init_wakeup(&pdev->dev, 1);
417+
device_init_wakeup(&pdev->dev, true);
418418
enable_irq_wake(rtc->irq);
419419
}
420420
} else {

drivers/rtc/rtc-renesas-rtca3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ static int rtca3_probe(struct platform_device *pdev)
768768
if (ret)
769769
return ret;
770770

771-
device_init_wakeup(&pdev->dev, 1);
771+
device_init_wakeup(&pdev->dev, true);
772772

773773
priv->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
774774
if (IS_ERR(priv->rtc_dev))

drivers/rtc/rtc-rk808.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ static int rk808_rtc_probe(struct platform_device *pdev)
418418
return ret;
419419
}
420420

421-
device_init_wakeup(&pdev->dev, 1);
421+
device_init_wakeup(&pdev->dev, true);
422422

423423
rk808_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
424424
if (IS_ERR(rk808_rtc->rtc))

drivers/rtc/rtc-s3c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ static int s3c_rtc_probe(struct platform_device *pdev)
456456
dev_dbg(&pdev->dev, "s3c2410_rtc: RTCCON=%02x\n",
457457
readw(info->base + S3C2410_RTCCON));
458458

459-
device_init_wakeup(&pdev->dev, 1);
459+
device_init_wakeup(&pdev->dev, true);
460460

461461
info->rtc = devm_rtc_allocate_device(&pdev->dev);
462462
if (IS_ERR(info->rtc)) {

drivers/rtc/rtc-s5m.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ static int s5m_rtc_probe(struct platform_device *pdev)
729729
info->irq, ret);
730730
return ret;
731731
}
732-
device_init_wakeup(&pdev->dev, 1);
732+
device_init_wakeup(&pdev->dev, true);
733733
}
734734

735735
return devm_rtc_register_device(info->rtc_dev);

drivers/rtc/rtc-sa1100.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ static int sa1100_rtc_probe(struct platform_device *pdev)
292292
}
293293

294294
platform_set_drvdata(pdev, info);
295-
device_init_wakeup(&pdev->dev, 1);
295+
device_init_wakeup(&pdev->dev, true);
296296

297297
return sa1100_rtc_init(pdev, info);
298298
}

0 commit comments

Comments
 (0)