Re: [PATCH v1] pwm: dwc: allow suspend/resume for 16 channels

From: Andy Shevchenko
Date: Fri Apr 12 2024 - 11:36:04 EST


On Fri, Apr 12, 2024 at 11:38:12AM +0530, Raag Jadav wrote:
> With 16 channel pwm support, we're registering two instances of pwm_chip
> with 8 channels each. We need to update PM functions to use both instances
> of pwm_chip during power state transitions.
>
> Introduce struct dwc_pwm_drvdata and use it as driver_data, which will
> maintain both instances of pwm_chip along with dwc_pwm_info and allow us
> to use them inside suspend/resume handles.

..

> + data = devm_kzalloc(dev, struct_size(data, chips, info->nr), GFP_KERNEL);
> + if (!data)
> + return dev_err_probe(dev, -ENOMEM, "Failed to allocate drvdata\n");

Haven't noticed before, but we do not print messages for -ENOMEM. Just return
the code.

--
With Best Regards,
Andy Shevchenko