Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1470290 > unrolled thread
| Started by | Olliver Schinagl <oliver@schinagl.nl> |
|---|---|
| First post | 2016-08-25 19:20 +0200 |
| Last post | 2016-09-05 12:20 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCHv2] pwm: lpc-18xx: use pwm_set_chip_data Olliver Schinagl <oliver@schinagl.nl> - 2016-08-25 19:20 +0200
Re: [PATCHv2] pwm: lpc-18xx: use pwm_set_chip_data Ariel D'Alessandro <ariel@vanguardiasur.com.ar> - 2016-09-02 18:10 +0200
Re: [PATCHv2] pwm: lpc-18xx: use pwm_set_chip_data Thierry Reding <thierry.reding@gmail.com> - 2016-09-05 12:20 +0200
| From | Olliver Schinagl <oliver@schinagl.nl> |
|---|---|
| Date | 2016-08-25 19:20 +0200 |
| Subject | [PATCHv2] pwm: lpc-18xx: use pwm_set_chip_data |
| Message-ID | <sa6tP-3Uf-11@gated-at.bofh.it> |
The lpc18xx driver currently manipulates the pwm_device struct directly
rather then using the pwm_set_chip_data. While the current method may
save a clock cycle or two, it is more obvious that data is set to
the local chip data pointer.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
---
Hi,
This is a resend of a patch-series I sent last year. There was no technical
related feedback and so I am re-sending the patch as is. I did rebase it to
Linus's current master.
Changes since v1:
- removed wrongfully added sun4i patch
- split patch series into a single patch
- added author
drivers/pwm/pwm-lpc18xx-sct.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/pwm/pwm-lpc18xx-sct.c b/drivers/pwm/pwm-lpc18xx-sct.c
index 19dc64c..a630fc5 100644
--- a/drivers/pwm/pwm-lpc18xx-sct.c
+++ b/drivers/pwm/pwm-lpc18xx-sct.c
@@ -413,14 +413,17 @@ static int lpc18xx_pwm_probe(struct platform_device *pdev)
}
for (i = 0; i < lpc18xx_pwm->chip.npwm; i++) {
+ struct lpc18xx_pwm_data *lpc18xx_data;
+
pwm = &lpc18xx_pwm->chip.pwms[i];
- pwm->chip_data = devm_kzalloc(lpc18xx_pwm->dev,
- sizeof(struct lpc18xx_pwm_data),
- GFP_KERNEL);
- if (!pwm->chip_data) {
+ lpc18xx_data = devm_kzalloc(lpc18xx_pwm->dev,
+ sizeof(struct lpc18xx_pwm_data),
+ GFP_KERNEL);
+ if (!lpc18xx_data) {
ret = -ENOMEM;
goto remove_pwmchip;
}
+ pwm_set_chip_data(pwm, lpc18xx_data);
}
platform_set_drvdata(pdev, lpc18xx_pwm);
--
2.8.1
[toc] | [next] | [standalone]
| From | Ariel D'Alessandro <ariel@vanguardiasur.com.ar> |
|---|---|
| Date | 2016-09-02 18:10 +0200 |
| Message-ID | <scZct-1CU-21@gated-at.bofh.it> |
| In reply to | #1470290 |
Hi Olliver,
On 08/25/2016 01:47 PM, Olliver Schinagl wrote:
> The lpc18xx driver currently manipulates the pwm_device struct directly
> rather then using the pwm_set_chip_data. While the current method may
> save a clock cycle or two, it is more obvious that data is set to
> the local chip data pointer.
>
> Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Reviewed-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
> ---
> Hi,
>
> This is a resend of a patch-series I sent last year. There was no technical
> related feedback and so I am re-sending the patch as is. I did rebase it to
> Linus's current master.
>
> Changes since v1:
> - removed wrongfully added sun4i patch
> - split patch series into a single patch
> - added author
>
> drivers/pwm/pwm-lpc18xx-sct.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pwm/pwm-lpc18xx-sct.c b/drivers/pwm/pwm-lpc18xx-sct.c
> index 19dc64c..a630fc5 100644
> --- a/drivers/pwm/pwm-lpc18xx-sct.c
> +++ b/drivers/pwm/pwm-lpc18xx-sct.c
> @@ -413,14 +413,17 @@ static int lpc18xx_pwm_probe(struct platform_device *pdev)
> }
>
> for (i = 0; i < lpc18xx_pwm->chip.npwm; i++) {
> + struct lpc18xx_pwm_data *lpc18xx_data;
> +
> pwm = &lpc18xx_pwm->chip.pwms[i];
> - pwm->chip_data = devm_kzalloc(lpc18xx_pwm->dev,
> - sizeof(struct lpc18xx_pwm_data),
> - GFP_KERNEL);
> - if (!pwm->chip_data) {
> + lpc18xx_data = devm_kzalloc(lpc18xx_pwm->dev,
> + sizeof(struct lpc18xx_pwm_data),
> + GFP_KERNEL);
> + if (!lpc18xx_data) {
> ret = -ENOMEM;
> goto remove_pwmchip;
> }
> + pwm_set_chip_data(pwm, lpc18xx_data);
> }
>
> platform_set_drvdata(pdev, lpc18xx_pwm);
>
--
Ariel D'Alessandro, VanguardiaSur
www.vanguardiasur.com.ar
[toc] | [prev] | [next] | [standalone]
| From | Thierry Reding <thierry.reding@gmail.com> |
|---|---|
| Date | 2016-09-05 12:20 +0200 |
| Message-ID | <sdZaq-2o0-13@gated-at.bofh.it> |
| In reply to | #1470290 |
[Multipart message — attachments visible in raw view] — view raw
On Thu, Aug 25, 2016 at 06:47:09PM +0200, Olliver Schinagl wrote: > The lpc18xx driver currently manipulates the pwm_device struct directly > rather then using the pwm_set_chip_data. While the current method may > save a clock cycle or two, it is more obvious that data is set to > the local chip data pointer. > > Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> > --- > Hi, > > This is a resend of a patch-series I sent last year. There was no technical > related feedback and so I am re-sending the patch as is. I did rebase it to > Linus's current master. > > Changes since v1: > - removed wrongfully added sun4i patch > - split patch series into a single patch > - added author > > drivers/pwm/pwm-lpc18xx-sct.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) Applied with minor bikeshedding. Thanks, Thierry
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web