Skip to content

Commit d8e0cec

Browse files
Keerthyjtmlind
authored andcommitted
soc: ti: pm33xx: Fix static checker warnings
The patch fixes a bunch of static checker warnings. Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Keerthy <[email protected]> Signed-off-by: Tony Lindgren <[email protected]>
1 parent 0c0d1ec commit d8e0cec

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/soc/ti/pm33xx.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static int am33xx_pm_begin(suspend_state_t state)
252252
if (state == PM_SUSPEND_MEM && pm_ops->check_off_mode_enable()) {
253253
nvmem = devm_nvmem_device_get(&omap_rtc->dev,
254254
"omap_rtc_scratch0");
255-
if (nvmem)
255+
if (!IS_ERR(nvmem))
256256
nvmem_device_write(nvmem, RTC_SCRATCH_MAGIC_REG * 4, 4,
257257
(void *)&rtc_magic_val);
258258
rtc_only_idle = 1;
@@ -278,9 +278,12 @@ static void am33xx_pm_end(void)
278278
struct nvmem_device *nvmem;
279279

280280
nvmem = devm_nvmem_device_get(&omap_rtc->dev, "omap_rtc_scratch0");
281+
if (IS_ERR(nvmem))
282+
return;
283+
281284
m3_ipc->ops->finish_low_power(m3_ipc);
282285
if (rtc_only_idle) {
283-
if (retrigger_irq)
286+
if (retrigger_irq) {
284287
/*
285288
* 32 bits of Interrupt Set-Pending correspond to 32
286289
* 32 interrupts. Compute the bit offset of the
@@ -291,8 +294,10 @@ static void am33xx_pm_end(void)
291294
writel_relaxed(1 << (retrigger_irq & 31),
292295
gic_dist_base + GIC_INT_SET_PENDING_BASE
293296
+ retrigger_irq / 32 * 4);
294-
nvmem_device_write(nvmem, RTC_SCRATCH_MAGIC_REG * 4, 4,
295-
(void *)&val);
297+
}
298+
299+
nvmem_device_write(nvmem, RTC_SCRATCH_MAGIC_REG * 4, 4,
300+
(void *)&val);
296301
}
297302

298303
rtc_only_idle = 0;
@@ -415,7 +420,7 @@ static int am33xx_pm_rtc_setup(void)
415420

416421
nvmem = devm_nvmem_device_get(&omap_rtc->dev,
417422
"omap_rtc_scratch0");
418-
if (nvmem) {
423+
if (!IS_ERR(nvmem)) {
419424
nvmem_device_read(nvmem, RTC_SCRATCH_MAGIC_REG * 4,
420425
4, (void *)&rtc_magic_val);
421426
if ((rtc_magic_val & 0xffff) != RTC_REG_BOOT_MAGIC)

0 commit comments

Comments
 (0)