On 12/22/2025 11:19 AM, Baochen Qiang wrote:
> 
> 
> On 12/19/2025 11:12 PM, Jeff Johnson wrote:
>> On 12/19/2025 2:32 AM, Baochen Qiang wrote:
>>>
>>>
>>> On 12/17/2025 7:19 PM, Uwe Kleine-König wrote:
>>>> This increases build coverage and removes an ugly #ifdef block.
>>>>
>>>> Signed-off-by: Uwe Kleine-König <[email protected]>
>>>> ---
>>>> Hello,
>>>>
>>>> I found the patch opportunity while looking in this driver for a different
>>>> reason.
>>>>
>>>> Best regards
>>>> Uwe
>>>>
>>>>  drivers/net/wireless/ath/ath10k/sdio.c | 12 +-----------
>>>>  1 file changed, 1 insertion(+), 11 deletions(-)
>>>>
>>>> diff --git a/drivers/net/wireless/ath/ath10k/sdio.c 
>>>> b/drivers/net/wireless/ath/ath10k/sdio.c
>>>> index c06d50db40b8..3efe744c0c96 100644
>>>> --- a/drivers/net/wireless/ath/ath10k/sdio.c
>>>> +++ b/drivers/net/wireless/ath/ath10k/sdio.c
>>>> @@ -2136,8 +2136,6 @@ static const struct ath10k_hif_ops 
>>>> ath10k_sdio_hif_ops = {
>>>>  #endif
>>>>  };
>>>>  
>>>> -#ifdef CONFIG_PM_SLEEP
>>>> -
>>>>  /* Empty handlers so that mmc subsystem doesn't remove us entirely during
>>>>   * suspend. We instead follow cfg80211 suspend/resume handlers.
>>>>   */
>>>> @@ -2175,14 +2173,6 @@ static int ath10k_sdio_pm_resume(struct device 
>>>> *device)
>>>>  static SIMPLE_DEV_PM_OPS(ath10k_sdio_pm_ops, ath10k_sdio_pm_suspend,
>>>>                     ath10k_sdio_pm_resume);
>>>>  
>>>> -#define ATH10K_SDIO_PM_OPS (&ath10k_sdio_pm_ops)
>>>> -
>>>> -#else
>>>> -
>>>> -#define ATH10K_SDIO_PM_OPS NULL
>>>> -
>>>> -#endif /* CONFIG_PM_SLEEP */
>>>> -
>>>>  static int ath10k_sdio_napi_poll(struct napi_struct *ctx, int budget)
>>>>  {
>>>>    struct ath10k *ar = container_of(ctx, struct ath10k, napi);
>>>> @@ -2668,7 +2658,7 @@ static struct sdio_driver ath10k_sdio_driver = {
>>>>    .probe = ath10k_sdio_probe,
>>>>    .remove = ath10k_sdio_remove,
>>>>    .drv = {
>>>> -          .pm = ATH10K_SDIO_PM_OPS,
>>>> +          .pm = pm_sleep_ptr(&ath10k_sdio_pm_ops),
>>>>    },
>>>>  };
>>>>  module_sdio_driver(ath10k_sdio_driver);
>>>>
>>>
>>> won't this cause defined-but-not-used warnings if CONFIG_PM_SLEEP not 
>>> enabled?
>>
>> no because SIMPLE_DEV_PM_OPS() adds __maybe_unused to the dev_pm_ops
> 
> Yeah ...
> 
> But the key here is ath10k_sdio_pm_suspend()/ath10k_sdio_pm_resume()

I mean with CONFIG_PM_SLEEP disabled, SIMPLE_DEV_PM_OPS expands to

        const struct dev_pm_ops __maybe_unused name = {
        /* nothing here*/
        }

hence compiler warns on ath10k_sdio_pm_suspend()/ath10k_sdio_pm_resume()

> 
>>
>>
> 


Reply via email to