Re: [PATCH] PM: wakeup: Add a missing return case in init_wakeup

From: Rafael J. Wysocki
Date: Thu Mar 14 2024 - 11:30:09 EST


On Thu, Mar 14, 2024 at 4:18 PM Dhruva Gole <d-gole@xxxxxx> wrote:
>
> Hi,
>
> On Mar 14, 2024 at 15:01:36 +0100, Rafael J. Wysocki wrote:
> > On Thu, Mar 14, 2024 at 8:55 AM Dhruva Gole <d-gole@xxxxxx> wrote:
> > >
> > > The device_wakeup_disable call can return an error if no dev exists
> > > however this was being ignored. Catch this return value and propagate it
> > > onward in device_init_wakeup.
> >
> > Why does this matter to the callers of device_init_wakeup()?
>
> If atall !dev->power.can_wakeup then the caller should know something is
> funny right?

What would the caller do with this information?

They attempted to disable wakeup on a device that doesn't exist or is
not wake-capable, and so what?