linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] pwm: tiehrpwm: don't build PM related functions when not needed
@ 2014-04-02 11:56 Wolfram Sang
  2014-04-02 11:56 ` [PATCH 2/2] pwm: tiehrpwm: inline accessor functions Wolfram Sang
  2014-05-21 10:01 ` [PATCH 1/2] pwm: tiehrpwm: don't build PM related functions when not needed Thierry Reding
  0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2014-04-02 11:56 UTC (permalink / raw)
  To: linux-pwm; +Cc: Wolfram Sang, Thierry Reding

From: Wolfram Sang <wsa@sang-engineering.com>

Fixes following warnings on AM335X with no PM_SLEEP

drivers/pwm/pwm-tiehrpwm.c:534:13: warning: 'ehrpwm_pwm_save_context' defined but not used [-Wunused-function]
drivers/pwm/pwm-tiehrpwm.c:548:13: warning: 'ehrpwm_pwm_restore_context' defined but not used [-Wunused-function]

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
---
 drivers/pwm/pwm-tiehrpwm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
index aee4471424d1..b2544296430a 100644
--- a/drivers/pwm/pwm-tiehrpwm.c
+++ b/drivers/pwm/pwm-tiehrpwm.c
@@ -531,6 +531,7 @@ static int ehrpwm_pwm_remove(struct platform_device *pdev)
 	return pwmchip_remove(&pc->chip);
 }
 
+#ifdef CONFIG_PM_SLEEP
 static void ehrpwm_pwm_save_context(struct ehrpwm_pwm_chip *pc)
 {
 	pm_runtime_get_sync(pc->chip.dev);
@@ -557,7 +558,6 @@ static void ehrpwm_pwm_restore_context(struct ehrpwm_pwm_chip *pc)
 	ehrpwm_write(pc->mmio_base, TBCTL, pc->ctx.tbctl);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int ehrpwm_pwm_suspend(struct device *dev)
 {
 	struct ehrpwm_pwm_chip *pc = dev_get_drvdata(dev);
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] pwm: tiehrpwm: inline accessor functions
  2014-04-02 11:56 [PATCH 1/2] pwm: tiehrpwm: don't build PM related functions when not needed Wolfram Sang
@ 2014-04-02 11:56 ` Wolfram Sang
  2014-05-21 10:01 ` [PATCH 1/2] pwm: tiehrpwm: don't build PM related functions when not needed Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2014-04-02 11:56 UTC (permalink / raw)
  To: linux-pwm; +Cc: Wolfram Sang, Thierry Reding

From: Wolfram Sang <wsa@sang-engineering.com>

These elementary functions should be inlined for fastest access. Also
fixes this warning as a side-effect (when no PM_SLEEP is selected):

drivers/pwm/pwm-tiehrpwm.c:141:12: warning: 'ehrpwm_read' defined but not used [-Wunused-function]

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
---
 drivers/pwm/pwm-tiehrpwm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
index b2544296430a..232a4be11e67 100644
--- a/drivers/pwm/pwm-tiehrpwm.c
+++ b/drivers/pwm/pwm-tiehrpwm.c
@@ -138,12 +138,12 @@ static inline struct ehrpwm_pwm_chip *to_ehrpwm_pwm_chip(struct pwm_chip *chip)
 	return container_of(chip, struct ehrpwm_pwm_chip, chip);
 }
 
-static u16 ehrpwm_read(void __iomem *base, int offset)
+static inline u16 ehrpwm_read(void __iomem *base, int offset)
 {
 	return readw(base + offset);
 }
 
-static void ehrpwm_write(void __iomem *base, int offset, unsigned int val)
+static inline void ehrpwm_write(void __iomem *base, int offset, unsigned int val)
 {
 	writew(val & 0xFFFF, base + offset);
 }
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] pwm: tiehrpwm: don't build PM related functions when not needed
  2014-04-02 11:56 [PATCH 1/2] pwm: tiehrpwm: don't build PM related functions when not needed Wolfram Sang
  2014-04-02 11:56 ` [PATCH 2/2] pwm: tiehrpwm: inline accessor functions Wolfram Sang
@ 2014-05-21 10:01 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2014-05-21 10:01 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-pwm, Wolfram Sang

[-- Attachment #1: Type: text/plain, Size: 607 bytes --]

On Wed, Apr 02, 2014 at 01:56:21PM +0200, Wolfram Sang wrote:
> From: Wolfram Sang <wsa@sang-engineering.com>
> 
> Fixes following warnings on AM335X with no PM_SLEEP
> 
> drivers/pwm/pwm-tiehrpwm.c:534:13: warning: 'ehrpwm_pwm_save_context' defined but not used [-Wunused-function]
> drivers/pwm/pwm-tiehrpwm.c:548:13: warning: 'ehrpwm_pwm_restore_context' defined but not used [-Wunused-function]
> 
> Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
> ---
>  drivers/pwm/pwm-tiehrpwm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Both patches applied, thanks.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-21 10:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-02 11:56 [PATCH 1/2] pwm: tiehrpwm: don't build PM related functions when not needed Wolfram Sang
2014-04-02 11:56 ` [PATCH 2/2] pwm: tiehrpwm: inline accessor functions Wolfram Sang
2014-05-21 10:01 ` [PATCH 1/2] pwm: tiehrpwm: don't build PM related functions when not needed Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).