[v4,0/4] DesignWare PWM improvements

Message ID 20240219033835.11369-1-raag.jadav@intel.com
Headers
Series DesignWare PWM improvements |

Message

Raag Jadav Feb. 19, 2024, 3:38 a.m. UTC
  This series implements 16 channel PWM support for Intel Elkhart Lake
along with minor cleanups for DesignWare PWM driver.

Changes since v3:
- Fix PM regression
- Add comment for removed error check
- Drop accepted patches
- Update tags

Changes since v2:
- Remove error code duplication from dev_err_probe()
- Update tags

Changes since v1:
- Drop redundant error check
- Provide dwc_pwm_init_one() to initialize one PWM instance
- Use dev_get_drvdata() instead of pci_get_drvdata()
- Use pm_sleep_ptr() instead of use pm_ptr()

Raag Jadav (4):
  pwm: dwc: Fix PM regression
  pwm: dwc: drop redundant error check
  pwm: dwc: Add 16 channel support for Intel Elkhart Lake
  pwm: dwc: simplify error handling

 drivers/pwm/pwm-dwc.c | 58 +++++++++++++++++++++++++++----------------
 drivers/pwm/pwm-dwc.h |  5 ++++
 2 files changed, 41 insertions(+), 22 deletions(-)


base-commit: 191fba33d814a855ac6a29d2c26a46fbe88d55b4
  

Comments

Thorsten Scherer Feb. 19, 2024, 7:11 a.m. UTC | #1
Hello,

On Mon, Feb 19, 2024 at 09:08:33AM +0530, Raag Jadav wrote:
> pcim_iomap_table() fails only if pcim_iomap_regions() fails. No need to
> check for failure if the latter is already successful.
> 
> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> ---
>  drivers/pwm/pwm-dwc.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c
> index c0e586688e57..7dbb72c80ef5 100644
> --- a/drivers/pwm/pwm-dwc.c
> +++ b/drivers/pwm/pwm-dwc.c
> @@ -51,11 +51,8 @@ static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id)
>  		return ret;
>  	}
>  
> +	/* No need to check for failure, pcim_iomap_regions() does it for us. */

IMHO this comment could be omitted.

>  	dwc->base = pcim_iomap_table(pci)[0];
> -	if (!dwc->base) {
> -		dev_err(dev, "Base address missing\n");
> -		return -ENOMEM;
> -	}
>  
>  	ret = devm_pwmchip_add(dev, chip);
>  	if (ret)
> -- 
> 2.35.3
> 
> 

Best regards
Thorsten
  
Uwe Kleine-König Feb. 20, 2024, 4 p.m. UTC | #2
Hello,

On Mon, Feb 19, 2024 at 09:08:31AM +0530, Raag Jadav wrote:
> This series implements 16 channel PWM support for Intel Elkhart Lake
> along with minor cleanups for DesignWare PWM driver.
> 
> Changes since v3:
> - Fix PM regression
> - Add comment for removed error check
> - Drop accepted patches
> - Update tags
> 
> Changes since v2:
> - Remove error code duplication from dev_err_probe()
> - Update tags
> 
> Changes since v1:
> - Drop redundant error check
> - Provide dwc_pwm_init_one() to initialize one PWM instance
> - Use dev_get_drvdata() instead of pci_get_drvdata()
> - Use pm_sleep_ptr() instead of use pm_ptr()
> 
> Raag Jadav (4):
>   pwm: dwc: Fix PM regression
>   pwm: dwc: drop redundant error check
>   pwm: dwc: Add 16 channel support for Intel Elkhart Lake
>   pwm: dwc: simplify error handling

I squashed patch #1 into the offending commit and applied patches #2 - #4 now to

https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next

Thanks
Uwe