* [PATCHv2] pwm: lpc-18xx: use pwm_set_chip_data
@ 2016-08-25 16:47 ` Olliver Schinagl
0 siblings, 0 replies; 7+ messages in thread
From: Olliver Schinagl @ 2016-08-25 16:47 UTC (permalink / raw)
To: Thierry Reding, Ariel D'Alessandro
Cc: Olliver Schinagl, linux-pwm, Joachim Eastwood, linux-kernel,
linux-arm-kernel
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCHv2] pwm: lpc-18xx: use pwm_set_chip_data
@ 2016-08-25 16:47 ` Olliver Schinagl
0 siblings, 0 replies; 7+ messages in thread
From: Olliver Schinagl @ 2016-08-25 16:47 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCHv2] pwm: lpc-18xx: use pwm_set_chip_data
@ 2016-08-25 16:47 ` Olliver Schinagl
0 siblings, 0 replies; 7+ messages in thread
From: Olliver Schinagl @ 2016-08-25 16:47 UTC (permalink / raw)
To: Thierry Reding, Ariel D'Alessandro
Cc: Joachim Eastwood, linux-pwm, linux-arm-kernel, linux-kernel,
Olliver Schinagl
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCHv2] pwm: lpc-18xx: use pwm_set_chip_data
2016-08-25 16:47 ` Olliver Schinagl
@ 2016-09-02 16:07 ` Ariel D'Alessandro
-1 siblings, 0 replies; 7+ messages in thread
From: Ariel D'Alessandro @ 2016-09-02 16:07 UTC (permalink / raw)
To: Olliver Schinagl, Thierry Reding, Ariel D'Alessandro
Cc: linux-pwm, Joachim Eastwood, linux-kernel, linux-arm-kernel
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCHv2] pwm: lpc-18xx: use pwm_set_chip_data
@ 2016-09-02 16:07 ` Ariel D'Alessandro
0 siblings, 0 replies; 7+ messages in thread
From: Ariel D'Alessandro @ 2016-09-02 16:07 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCHv2] pwm: lpc-18xx: use pwm_set_chip_data
2016-08-25 16:47 ` Olliver Schinagl
@ 2016-09-05 10:15 ` Thierry Reding
-1 siblings, 0 replies; 7+ messages in thread
From: Thierry Reding @ 2016-09-05 10:15 UTC (permalink / raw)
To: Olliver Schinagl
Cc: Ariel D'Alessandro, Joachim Eastwood, linux-pwm,
linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 874 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCHv2] pwm: lpc-18xx: use pwm_set_chip_data
@ 2016-09-05 10:15 ` Thierry Reding
0 siblings, 0 replies; 7+ messages in thread
From: Thierry Reding @ 2016-09-05 10:15 UTC (permalink / raw)
To: linux-arm-kernel
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160905/e6185af0/attachment.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-09-05 10:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-25 16:47 [PATCHv2] pwm: lpc-18xx: use pwm_set_chip_data Olliver Schinagl
2016-08-25 16:47 ` Olliver Schinagl
2016-08-25 16:47 ` Olliver Schinagl
2016-09-02 16:07 ` Ariel D'Alessandro
2016-09-02 16:07 ` Ariel D'Alessandro
2016-09-05 10:15 ` Thierry Reding
2016-09-05 10:15 ` Thierry Reding
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.