TI AM335x TSC/ADC cleanup
Subsystems (4)
cover TI AM335x TSC/ADC cleanup
Hello all,
This series is a group of non-functional changes I would like to get in this cycle to prepare some regmap based changes I would like to make next cycle. Hopefully the churn can be seen as more useful in that case.
Thanks,
Andrew
Andrew F. Davis (8):
mfd: ti_am335x_tscadc: Use SIMPLE_DEV_PM_OPS helper macro
iio: adc: ti_am335x_adc: use SIMPLE_DEV_PM_OPS helper macro
mfd: ti_am335x_tscadc: Remove use of single line functions
mfd: ti_am335x_tscadc: Unify variable naming when refrencing
ti_tscadc_dev
mfd: ti_am335x_tscadc: Rename regmap_tscadc to regmap
mfd: ti_am335x_tscadc: use variable name for sizeof() operator
iio: adc: ti_am335x_adc: use variable names for sizeof() operator
Input: ti_am335x_tsc - use variable name for sizeof() operator
drivers/iio/adc/ti_am335x_adc.c | 22 ++--- drivers/input/touchscreen/ti_am335x_tsc.c | 2 +- drivers/mfd/ti_am335x_tscadc.c | 135 +++++++++++++----------------- include/linux/mfd/ti_am335x_tscadc.h | 2 +- 4 files changed, 64 insertions(+), 97 deletions(-)
Signature · 1 line
2.8.3
PATCH 1/8 mfd: ti_am335x_tscadc: Use SIMPLE_DEV_PM_OPS helper macro
Replace ifdefs with SIMPLE_DEV_PM_OPS helper macro.
--- drivers/mfd/ti_am335x_tscadc.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/mfd/ti_am335x_tscadc.c +4 -12
@@ -310,8 +310,7 @@ static int ti_tscadc_remove(struct platform_device *pdev)return 0 ; } -#ifdef CONFIG_PM -static int tscadc_suspend (struct device *dev) +static int __maybe_unused tscadc_suspend (struct device *dev) {struct ti_tscadc_dev *tscadc_dev =dev_get_drvdata (dev);
@@ -321,7 +320,7 @@ static int tscadc_suspend(struct device *dev)return 0 ; } -static int tscadc_resume (struct device *dev) +static int __maybe_unused tscadc_resume (struct device *dev) {struct ti_tscadc_dev *tscadc_dev =dev_get_drvdata (dev);u32 ctrl;
@@ -347,14 +346,7 @@ static int tscadc_resume(struct device *dev)return 0 ; } -static const struct dev_pm_ops tscadc_pm_ops = { - .suspend = tscadc_suspend, - .resume = tscadc_resume, -}; -#define TSCADC_PM_OPS (&tscadc_pm_ops) -#else -#define TSCADC_PM_OPS NULL -#endif +static SIMPLE_DEV_PM_OPS(tscadc_pm_ops, tscadc_suspend, tscadc_resume);static const struct of_device_id ti_tscadc_dt_ids[] = { { .compatible ="ti,am3359-tscadc" , },
@@ -365,7 +357,7 @@ MODULE_DEVICE_TABLE(of, ti_tscadc_dt_ids);static struct platform_driver ti_tscadc_driver = { .driver = { .name ="ti_am3359-tscadc" , - .pm =TSCADC_PM_OPS , + .pm = &tscadc_pm_ops, .of_match_table = ti_tscadc_dt_ids, }, .probe = ti_tscadc_probe,
Signature · 1 line
2.8.3
Re: [PATCH 1/8] mfd: ti_am335x_tscadc: Use SIMPLE_DEV_PM_OPS helper macro
Quoted 6 lines · Andrew F. Davis
Replace ifdefs with
SIMPLE_DEV_PM_OPShelper macro.Signed-off-by Andrew F. Davis <[email protected]>--- drivers/mfd/ti_am335x_tscadc.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
Quoted 48 lines
drivers/mfd/ti_am335x_tscadc.c +4
-12@@ -310,8 +310,7 @@ static int ti_tscadc_remove(struct platform_device *pdev)return 0 ; } -#ifdef CONFIG_PM -static int tscadc_suspend (struct device *dev) +static int __maybe_unused tscadc_suspend (struct device *dev) {struct ti_tscadc_dev *tscadc_dev =dev_get_drvdata (dev);@@ -321,7 +320,7 @@ static int tscadc_suspend(struct device *dev)return 0 ; } -static int tscadc_resume (struct device *dev) +static int __maybe_unused tscadc_resume (struct device *dev) {struct ti_tscadc_dev *tscadc_dev =dev_get_drvdata (dev);u32 ctrl;@@ -347,14 +346,7 @@ static int tscadc_resume(struct device *dev)return 0 ; } -static const struct dev_pm_ops tscadc_pm_ops = { - .suspend = tscadc_suspend, - .resume = tscadc_resume, -}; -#define TSCADC_PM_OPS (&tscadc_pm_ops) -#else -#define TSCADC_PM_OPS NULL -#endif +static SIMPLE_DEV_PM_OPS(tscadc_pm_ops, tscadc_suspend, tscadc_resume);static const struct of_device_id ti_tscadc_dt_ids[] = { { .compatible ="ti,am3359-tscadc" , },@@ -365,7 +357,7 @@ MODULE_DEVICE_TABLE(of, ti_tscadc_dt_ids);static struct platform_driver ti_tscadc_driver = { .driver = { .name ="ti_am3359-tscadc" , - .pm =TSCADC_PM_OPS , + .pm = &tscadc_pm_ops, .of_match_table = ti_tscadc_dt_ids, }, .probe = ti_tscadc_probe,
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 2/8 iio: adc: ti_am335x_adc: use SIMPLE_DEV_PM_OPS helper macro
In reply to Andrew F. DavisReplace ifdefs with SIMPLE_DEV_PM_OPS helper macro.
--- drivers/iio/adc/ti_am335x_adc.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/iio/adc/ti_am335x_adc.c +4 -12
@@ -531,8 +531,7 @@ static int tiadc_remove(struct platform_device *pdev)return 0 ; } -#ifdef CONFIG_PM -static int tiadc_suspend (struct device *dev) +static int __maybe_unused tiadc_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct tiadc_device *adc_dev =iio_priv (indio_dev);
@@ -550,7 +549,7 @@ static int tiadc_suspend(struct device *dev)return 0 ; } -static int tiadc_resume (struct device *dev) +static int __maybe_unused tiadc_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct tiadc_device *adc_dev =iio_priv (indio_dev);
@@ -567,14 +566,7 @@ static int tiadc_resume(struct device *dev)return 0 ; } -static const struct dev_pm_ops tiadc_pm_ops = { - .suspend = tiadc_suspend, - .resume = tiadc_resume, -}; -#define TIADC_PM_OPS (&tiadc_pm_ops) -#else -#define TIADC_PM_OPS NULL -#endif +static SIMPLE_DEV_PM_OPS(tiadc_pm_ops, tiadc_suspend, tiadc_resume);static const struct of_device_id ti_adc_dt_ids[] = { { .compatible ="ti,am3359-adc" , },
@@ -585,7 +577,7 @@ MODULE_DEVICE_TABLE(of, ti_adc_dt_ids);static struct platform_driver tiadc_driver = { .driver = { .name ="TI-am335x-adc" , - .pm =TIADC_PM_OPS , + .pm = &tiadc_pm_ops, .of_match_table = ti_adc_dt_ids, }, .probe = tiadc_probe,
Signature · 1 line
2.8.3
Jonathan Cameron
maintainerRe: [PATCH 2/8] iio: adc: ti_am335x_adc: use SIMPLE_DEV_PM_OPS helper macro
Quoted 3 lines · Andrew F. Davis
Replace ifdefs with
SIMPLE_DEV_PM_OPShelper macro.Signed-off-by Andrew F. Davis <[email protected]>
Applied to the togreg branch of iio.git - initially pushed out as testing for the autobuilders to play with it.
Thanks,
Jonathan
Quoted 53 lines
--- drivers/iio/adc/ti_am335x_adc.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)drivers/iio/adc/ti_am335x_adc.c +4
-12@@ -531,8 +531,7 @@ static int tiadc_remove(struct platform_device *pdev)return 0 ; } -#ifdef CONFIG_PM -static int tiadc_suspend (struct device *dev) +static int __maybe_unused tiadc_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct tiadc_device *adc_dev =iio_priv (indio_dev);@@ -550,7 +549,7 @@ static int tiadc_suspend(struct device *dev)return 0 ; } -static int tiadc_resume (struct device *dev) +static int __maybe_unused tiadc_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct tiadc_device *adc_dev =iio_priv (indio_dev);@@ -567,14 +566,7 @@ static int tiadc_resume(struct device *dev)return 0 ; } -static const struct dev_pm_ops tiadc_pm_ops = { - .suspend = tiadc_suspend, - .resume = tiadc_resume, -}; -#define TIADC_PM_OPS (&tiadc_pm_ops) -#else -#define TIADC_PM_OPS NULL -#endif +static SIMPLE_DEV_PM_OPS(tiadc_pm_ops, tiadc_suspend, tiadc_resume);static const struct of_device_id ti_adc_dt_ids[] = { { .compatible ="ti,am3359-adc" , },@@ -585,7 +577,7 @@ MODULE_DEVICE_TABLE(of, ti_adc_dt_ids);static struct platform_driver tiadc_driver = { .driver = { .name ="TI-am335x-adc" , - .pm =TIADC_PM_OPS , + .pm = &tiadc_pm_ops, .of_match_table = ti_adc_dt_ids, }, .probe = tiadc_probe,
PATCH 3/8 mfd: ti_am335x_tscadc: Remove use of single line functions
In reply to Andrew F. Davistscadc_readl and tscadc_writel are single line functions and do not save use anything, remove these.
--- drivers/mfd/ti_am335x_tscadc.c | 44 ++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 29 deletions(-)
drivers/mfd/ti_am335x_tscadc.c +15 -29
@@ -27,20 +27,6 @@#include <linux/mfd/ti_am335x_tscadc.h> -static unsigned int tscadc_readl (struct ti_tscadc_dev *tsadc,unsigned int reg) -{ -unsigned int val; - -regmap_read (tsadc->regmap_tscadc, reg, &val); -return val; -} - -static void tscadc_writel (struct ti_tscadc_dev *tsadc,unsigned int reg, -unsigned int val) -{ -regmap_write (tsadc->regmap_tscadc, reg, val); -} -static const struct regmap_config tscadc_regmap_config = { .name ="ti_tscadc" , .reg_bits =32 ,
@@ -57,7 +43,7 @@ void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val)if (tsadc->adc_waiting)wake_up (&tsadc->reg_se_wait);else if (!tsadc->adc_in_use) -tscadc_writel (tsadc,REG_SE , tsadc->reg_se_cache); +regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache);spin_unlock_irqrestore (&tsadc->reg_lock, flags); }
@@ -68,7 +54,7 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)DEFINE_WAIT (wait);u32 reg; - reg =tscadc_readl (tsadc,REG_ADCFSM ); +regmap_read (tsadc->regmap_tscadc,REG_ADCFSM , ®);if (reg &SEQ_STATUS ) { tsadc->adc_waiting = true; prepare_to_wait(&tsadc->reg_se_wait, &wait,
@@ -84,7 +70,7 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)* Sequencer should either be idle or * busy applying the charge step. */ - reg =tscadc_readl (tsadc,REG_ADCFSM ); +regmap_read (tsadc->regmap_tscadc,REG_ADCFSM , ®);WARN_ON ((reg &SEQ_STATUS ) && !(reg &CHARGE_STEP )); tsadc->adc_waiting = false; }
@@ -96,7 +82,7 @@ void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)spin_lock_irq (&tsadc->reg_lock);am335x_tscadc_need_adc (tsadc); -tscadc_writel (tsadc,REG_SE , val); +regmap_write (tsadc->regmap_tscadc,REG_SE , val);spin_unlock_irq (&tsadc->reg_lock); }EXPORT_SYMBOL_GPL (am335x_tsc_se_set_once);
@@ -107,7 +93,7 @@ void am335x_tsc_se_adc_done(struct ti_tscadc_dev *tsadc)spin_lock_irqsave (&tsadc->reg_lock, flags); tsadc->adc_in_use = false; -tscadc_writel (tsadc,REG_SE , tsadc->reg_se_cache); +regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache);spin_unlock_irqrestore (&tsadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_adc_done);
@@ -118,7 +104,7 @@ void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val)spin_lock_irqsave (&tsadc->reg_lock, flags); tsadc->reg_se_cache &= ~val; -tscadc_writel (tsadc,REG_SE , tsadc->reg_se_cache); +regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache);spin_unlock_irqrestore (&tsadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_clr);
@@ -130,7 +116,7 @@ static void tscadc_idle_config(struct ti_tscadc_dev *config) idleconfig =STEPCONFIG_YNN |STEPCONFIG_INM_ADCREFM |STEPCONFIG_INP_ADCREFM |STEPCONFIG_YPN ; -tscadc_writel (config,REG_IDLECONFIG , idleconfig); +regmap_write (config->regmap_tscadc,REG_IDLECONFIG , idleconfig); }static int ti_tscadc_probe (struct platform_device *pdev)
@@ -236,11 +222,11 @@ static int ti_tscadc_probe(struct platform_device *pdev)/* TSCADC_CLKDIV needs to be configured to the value minus 1 */ tscadc->clk_div--; -tscadc_writel (tscadc,REG_CLKDIV , tscadc->clk_div); +regmap_write (tscadc->regmap_tscadc,REG_CLKDIV , tscadc->clk_div);/* Set the control register bits */ ctrl =CNTRLREG_STEPCONFIGWRT |CNTRLREG_STEPID ; -tscadc_writel (tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl);/* Set register bits for Idle Config Mode */ if (tsc_wires >0 ) {
@@ -254,7 +240,7 @@ static int ti_tscadc_probe(struct platform_device *pdev)/* Enable the TSC module enable bit */ ctrl |=CNTRLREG_TSCSSENB ; -tscadc_writel (tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); tscadc->used_cells =0 ; tscadc->tsc_cell =-1 ;
@@ -300,7 +286,7 @@ static int ti_tscadc_remove(struct platform_device *pdev) {struct ti_tscadc_dev *tscadc =platform_get_drvdata (pdev); -tscadc_writel (tscadc,REG_SE ,0x00 ); +regmap_write (tscadc->regmap_tscadc,REG_SE ,0x00 );pm_runtime_put_sync (&pdev->dev);pm_runtime_disable (&pdev->dev);
@@ -314,7 +300,7 @@ static int __maybe_unused tscadc_suspend(struct device *dev) {struct ti_tscadc_dev *tscadc_dev =dev_get_drvdata (dev); -tscadc_writel (tscadc_dev,REG_SE ,0x00 ); +regmap_write (tscadc_dev->regmap_tscadc,REG_SE ,0x00 );pm_runtime_put_sync (dev);return 0 ;
@@ -329,7 +315,7 @@ static int __maybe_unused tscadc_resume(struct device *dev)/* context restore */ ctrl =CNTRLREG_STEPCONFIGWRT |CNTRLREG_STEPID ; -tscadc_writel (tscadc_dev,REG_CTRL , ctrl); +regmap_write (tscadc_dev->regmap_tscadc,REG_CTRL , ctrl);if (tscadc_dev->tsc_cell !=-1 ) {if (tscadc_dev->tsc_wires ==5 )
@@ -339,9 +325,9 @@ static int __maybe_unused tscadc_resume(struct device *dev)tscadc_idle_config (tscadc_dev); } ctrl |=CNTRLREG_TSCSSENB ; -tscadc_writel (tscadc_dev,REG_CTRL , ctrl); +regmap_write (tscadc_dev->regmap_tscadc,REG_CTRL , ctrl); -tscadc_writel (tscadc_dev,REG_CLKDIV , tscadc_dev->clk_div); +regmap_write (tscadc_dev->regmap_tscadc,REG_CLKDIV , tscadc_dev->clk_div);return 0 ; }
Signature · 1 line
2.8.3
Re: [PATCH 3/8] mfd: ti_am335x_tscadc: Remove use of single line functions
Quoted 2 lines · Andrew F. Davis
tscadc_readlandtscadc_writelare single line functions and do not save use anything, remove these.
Right. I usually push back on these type of abstraction when they are submitted.
Quoted 155 lines
Signed-off-by Andrew F. Davis <[email protected]>--- drivers/mfd/ti_am335x_tscadc.c | 44 ++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 29 deletions(-)drivers/mfd/ti_am335x_tscadc.c +15
-29@@ -27,20 +27,6 @@#include <linux/mfd/ti_am335x_tscadc.h> -static unsigned int tscadc_readl (struct ti_tscadc_dev *tsadc,unsigned int reg) -{ -unsigned int val; - -regmap_read (tsadc->regmap_tscadc, reg, &val); -return val; -} - -static void tscadc_writel (struct ti_tscadc_dev *tsadc,unsigned int reg, -unsigned int val) -{ -regmap_write (tsadc->regmap_tscadc, reg, val); -} -static const struct regmap_config tscadc_regmap_config = { .name ="ti_tscadc" , .reg_bits =32 ,@@ -57,7 +43,7 @@ void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val)if (tsadc->adc_waiting)wake_up (&tsadc->reg_se_wait);else if (!tsadc->adc_in_use) -tscadc_writel (tsadc,REG_SE , tsadc->reg_se_cache); +regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache);spin_unlock_irqrestore (&tsadc->reg_lock, flags); }@@ -68,7 +54,7 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)DEFINE_WAIT (wait);u32 reg; - reg =tscadc_readl (tsadc,REG_ADCFSM ); +regmap_read (tsadc->regmap_tscadc,REG_ADCFSM , ®);if (reg &SEQ_STATUS ) { tsadc->adc_waiting = true; prepare_to_wait(&tsadc->reg_se_wait, &wait,@@ -84,7 +70,7 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)* Sequencer should either be idle or * busy applying the charge step. */ - reg =tscadc_readl (tsadc,REG_ADCFSM ); +regmap_read (tsadc->regmap_tscadc,REG_ADCFSM , ®);WARN_ON ((reg &SEQ_STATUS ) && !(reg &CHARGE_STEP )); tsadc->adc_waiting = false; }@@ -96,7 +82,7 @@ void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)spin_lock_irq (&tsadc->reg_lock);am335x_tscadc_need_adc (tsadc); -tscadc_writel (tsadc,REG_SE , val); +regmap_write (tsadc->regmap_tscadc,REG_SE , val);spin_unlock_irq (&tsadc->reg_lock); }EXPORT_SYMBOL_GPL (am335x_tsc_se_set_once);@@ -107,7 +93,7 @@ void am335x_tsc_se_adc_done(struct ti_tscadc_dev *tsadc)spin_lock_irqsave (&tsadc->reg_lock, flags); tsadc->adc_in_use = false; -tscadc_writel (tsadc,REG_SE , tsadc->reg_se_cache); +regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache);spin_unlock_irqrestore (&tsadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_adc_done);@@ -118,7 +104,7 @@ void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val)spin_lock_irqsave (&tsadc->reg_lock, flags); tsadc->reg_se_cache &= ~val; -tscadc_writel (tsadc,REG_SE , tsadc->reg_se_cache); +regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache);spin_unlock_irqrestore (&tsadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_clr);@@ -130,7 +116,7 @@ static void tscadc_idle_config(struct ti_tscadc_dev *config) idleconfig =STEPCONFIG_YNN |STEPCONFIG_INM_ADCREFM |STEPCONFIG_INP_ADCREFM |STEPCONFIG_YPN ; -tscadc_writel (config,REG_IDLECONFIG , idleconfig); +regmap_write (config->regmap_tscadc,REG_IDLECONFIG , idleconfig); }static int ti_tscadc_probe (struct platform_device *pdev)@@ -236,11 +222,11 @@ static int ti_tscadc_probe(struct platform_device *pdev)/* TSCADC_CLKDIV needs to be configured to the value minus 1 */ tscadc->clk_div--; -tscadc_writel (tscadc,REG_CLKDIV , tscadc->clk_div); +regmap_write (tscadc->regmap_tscadc,REG_CLKDIV , tscadc->clk_div);/* Set the control register bits */ ctrl =CNTRLREG_STEPCONFIGWRT |CNTRLREG_STEPID ; -tscadc_writel (tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl);/* Set register bits for Idle Config Mode */ if (tsc_wires >0 ) {@@ -254,7 +240,7 @@ static int ti_tscadc_probe(struct platform_device *pdev)/* Enable the TSC module enable bit */ ctrl |=CNTRLREG_TSCSSENB ; -tscadc_writel (tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); tscadc->used_cells =0 ; tscadc->tsc_cell =-1 ;@@ -300,7 +286,7 @@ static int ti_tscadc_remove(struct platform_device *pdev) {struct ti_tscadc_dev *tscadc =platform_get_drvdata (pdev); -tscadc_writel (tscadc,REG_SE ,0x00 ); +regmap_write (tscadc->regmap_tscadc,REG_SE ,0x00 );pm_runtime_put_sync (&pdev->dev);pm_runtime_disable (&pdev->dev);@@ -314,7 +300,7 @@ static int __maybe_unused tscadc_suspend(struct device *dev) {struct ti_tscadc_dev *tscadc_dev =dev_get_drvdata (dev); -tscadc_writel (tscadc_dev,REG_SE ,0x00 ); +regmap_write (tscadc_dev->regmap_tscadc,REG_SE ,0x00 );pm_runtime_put_sync (dev);return 0 ;@@ -329,7 +315,7 @@ static int __maybe_unused tscadc_resume(struct device *dev)/* context restore */ ctrl =CNTRLREG_STEPCONFIGWRT |CNTRLREG_STEPID ; -tscadc_writel (tscadc_dev,REG_CTRL , ctrl); +regmap_write (tscadc_dev->regmap_tscadc,REG_CTRL , ctrl);if (tscadc_dev->tsc_cell !=-1 ) {if (tscadc_dev->tsc_wires ==5 )@@ -339,9 +325,9 @@ static int __maybe_unused tscadc_resume(struct device *dev)tscadc_idle_config (tscadc_dev); } ctrl |=CNTRLREG_TSCSSENB ; -tscadc_writel (tscadc_dev,REG_CTRL , ctrl); +regmap_write (tscadc_dev->regmap_tscadc,REG_CTRL , ctrl); -tscadc_writel (tscadc_dev,REG_CLKDIV , tscadc_dev->clk_div); +regmap_write (tscadc_dev->regmap_tscadc,REG_CLKDIV , tscadc_dev->clk_div);return 0 ; }
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 4/8 mfd: ti_am335x_tscadc: Unify variable naming when refrencing ti_tscadc_dev
In reply to Andrew F. DavisAll functions in this driver reference the same ti_tscadc_dev per device but use several different names for this structure pointer, this can be confusing when following the code. Use the name 'tscadc' everywhere.
--- drivers/mfd/ti_am335x_tscadc.c | 88 +++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 44 deletions(-)
drivers/mfd/ti_am335x_tscadc.c +44 -44
@@ -34,89 +34,89 @@ static const struct regmap_config tscadc_regmap_config = { .val_bits = 32, }; -void am335x_tsc_se_set_cache (struct ti_tscadc_dev *tsadc,u32 val) +void am335x_tsc_se_set_cache (struct ti_tscadc_dev *tscadc,u32 val) {unsigned long flags; -spin_lock_irqsave (&tsadc->reg_lock, flags); - tsadc->reg_se_cache |= val; -if (tsadc->adc_waiting) -wake_up (&tsadc->reg_se_wait); -else if (!tsadc->adc_in_use) -regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache); +spin_lock_irqsave (&tscadc->reg_lock, flags); + tscadc->reg_se_cache |= val; +if (tscadc->adc_waiting) +wake_up (&tscadc->reg_se_wait); +else if (!tscadc->adc_in_use) +regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); -spin_unlock_irqrestore (&tsadc->reg_lock, flags); +spin_unlock_irqrestore (&tscadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_set_cache); -static void am335x_tscadc_need_adc (struct ti_tscadc_dev *tsadc) +static void am335x_tscadc_need_adc (struct ti_tscadc_dev *tscadc) {DEFINE_WAIT (wait);u32 reg; -regmap_read (tsadc->regmap_tscadc,REG_ADCFSM , ®); +regmap_read (tscadc->regmap_tscadc,REG_ADCFSM , ®);if (reg &SEQ_STATUS ) { - tsadc->adc_waiting = true; -prepare_to_wait (&tsadc->reg_se_wait, &wait, + tscadc->adc_waiting = true; +prepare_to_wait (&tscadc->reg_se_wait, &wait,TASK_UNINTERRUPTIBLE ); -spin_unlock_irq (&tsadc->reg_lock); +spin_unlock_irq (&tscadc->reg_lock);schedule (); -spin_lock_irq (&tsadc->reg_lock); -finish_wait (&tsadc->reg_se_wait, &wait); +spin_lock_irq (&tscadc->reg_lock); +finish_wait (&tscadc->reg_se_wait, &wait);/* * Sequencer should either be idle or * busy applying the charge step. */ -regmap_read (tsadc->regmap_tscadc,REG_ADCFSM , ®); +regmap_read (tscadc->regmap_tscadc,REG_ADCFSM , ®);WARN_ON ((reg &SEQ_STATUS ) && !(reg &CHARGE_STEP )); - tsadc->adc_waiting = false; + tscadc->adc_waiting = false; } - tsadc->adc_in_use = true; + tscadc->adc_in_use = true; } -void am335x_tsc_se_set_once (struct ti_tscadc_dev *tsadc,u32 val) +void am335x_tsc_se_set_once (struct ti_tscadc_dev *tscadc,u32 val) { -spin_lock_irq (&tsadc->reg_lock); -am335x_tscadc_need_adc (tsadc); +spin_lock_irq (&tscadc->reg_lock); +am335x_tscadc_need_adc (tscadc); -regmap_write (tsadc->regmap_tscadc,REG_SE , val); -spin_unlock_irq (&tsadc->reg_lock); +regmap_write (tscadc->regmap_tscadc,REG_SE , val); +spin_unlock_irq (&tscadc->reg_lock); }EXPORT_SYMBOL_GPL (am335x_tsc_se_set_once); -void am335x_tsc_se_adc_done (struct ti_tscadc_dev *tsadc) +void am335x_tsc_se_adc_done (struct ti_tscadc_dev *tscadc) {unsigned long flags; -spin_lock_irqsave (&tsadc->reg_lock, flags); - tsadc->adc_in_use = false; -regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache); -spin_unlock_irqrestore (&tsadc->reg_lock, flags); +spin_lock_irqsave (&tscadc->reg_lock, flags); + tscadc->adc_in_use = false; +regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); +spin_unlock_irqrestore (&tscadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_adc_done); -void am335x_tsc_se_clr (struct ti_tscadc_dev *tsadc,u32 val) +void am335x_tsc_se_clr (struct ti_tscadc_dev *tscadc,u32 val) {unsigned long flags; -spin_lock_irqsave (&tsadc->reg_lock, flags); - tsadc->reg_se_cache &= ~val; -regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache); -spin_unlock_irqrestore (&tsadc->reg_lock, flags); +spin_lock_irqsave (&tscadc->reg_lock, flags); + tscadc->reg_se_cache &= ~val; +regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); +spin_unlock_irqrestore (&tscadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_clr); -static void tscadc_idle_config (struct ti_tscadc_dev *config) +static void tscadc_idle_config (struct ti_tscadc_dev *tscadc) {unsigned int idleconfig; idleconfig =STEPCONFIG_YNN |STEPCONFIG_INM_ADCREFM |STEPCONFIG_INP_ADCREFM |STEPCONFIG_YPN ; -regmap_write (config->regmap_tscadc,REG_IDLECONFIG , idleconfig); +regmap_write (tscadc->regmap_tscadc,REG_IDLECONFIG , idleconfig); }static int ti_tscadc_probe (struct platform_device *pdev)
@@ -298,9 +298,9 @@ static int ti_tscadc_remove(struct platform_device *pdev)static int __maybe_unused tscadc_suspend (struct device *dev) { -struct ti_tscadc_dev *tscadc_dev =dev_get_drvdata (dev); +struct ti_tscadc_dev *tscadc =dev_get_drvdata (dev); -regmap_write (tscadc_dev->regmap_tscadc,REG_SE ,0x00 ); +regmap_write (tscadc->regmap_tscadc,REG_SE ,0x00 );pm_runtime_put_sync (dev);return 0 ;
@@ -308,26 +308,26 @@ static int __maybe_unused tscadc_suspend(struct device *dev)static int __maybe_unused tscadc_resume (struct device *dev) { -struct ti_tscadc_dev *tscadc_dev =dev_get_drvdata (dev); +struct ti_tscadc_dev *tscadc =dev_get_drvdata (dev);u32 ctrl;pm_runtime_get_sync (dev);/* context restore */ ctrl =CNTRLREG_STEPCONFIGWRT |CNTRLREG_STEPID ; -regmap_write (tscadc_dev->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); -if (tscadc_dev->tsc_cell !=-1 ) { -if (tscadc_dev->tsc_wires ==5 ) +if (tscadc->tsc_cell !=-1 ) { +if (tscadc->tsc_wires ==5 ) ctrl |=CNTRLREG_5WIRE |CNTRLREG_TSCENB ;else ctrl |=CNTRLREG_4WIRE |CNTRLREG_TSCENB ; -tscadc_idle_config (tscadc_dev); +tscadc_idle_config (tscadc); } ctrl |=CNTRLREG_TSCSSENB ; -regmap_write (tscadc_dev->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); -regmap_write (tscadc_dev->regmap_tscadc,REG_CLKDIV , tscadc_dev->clk_div); +regmap_write (tscadc->regmap_tscadc,REG_CLKDIV , tscadc->clk_div);return 0 ; }
Signature · 1 line
2.8.3
Re: [PATCH 4/8] mfd: ti_am335x_tscadc: Unify variable naming when refrencing ti_tscadc_dev
Hi,
Quoted 4 lines · Andrew F. Davis
All functions in this driver reference the same
ti_tscadc_devper device but use several different names for this structure pointer, this can be confusing when following the code. Use the name 'tscadc' everywhere.
$subject typo: "refrencing" should be "referencing"
Regards,
Dave
Quoted 181 lines
Signed-off-by Andrew F. Davis <[email protected]>--- drivers/mfd/ti_am335x_tscadc.c | 88 +++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 44 deletions(-)drivers/mfd/ti_am335x_tscadc.c +44
-44@@ -34,89 +34,89 @@ static const struct regmap_config tscadc_regmap_config = { .val_bits = 32, }; -void am335x_tsc_se_set_cache (struct ti_tscadc_dev *tsadc,u32 val) +void am335x_tsc_se_set_cache (struct ti_tscadc_dev *tscadc,u32 val) {unsigned long flags; -spin_lock_irqsave (&tsadc->reg_lock, flags); - tsadc->reg_se_cache |= val; -if (tsadc->adc_waiting) -wake_up (&tsadc->reg_se_wait); -else if (!tsadc->adc_in_use) -regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache); +spin_lock_irqsave (&tscadc->reg_lock, flags); + tscadc->reg_se_cache |= val; +if (tscadc->adc_waiting) +wake_up (&tscadc->reg_se_wait); +else if (!tscadc->adc_in_use) +regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); -spin_unlock_irqrestore (&tsadc->reg_lock, flags); +spin_unlock_irqrestore (&tscadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_set_cache); -static void am335x_tscadc_need_adc (struct ti_tscadc_dev *tsadc) +static void am335x_tscadc_need_adc (struct ti_tscadc_dev *tscadc) {DEFINE_WAIT (wait);u32 reg; -regmap_read (tsadc->regmap_tscadc,REG_ADCFSM , ®); +regmap_read (tscadc->regmap_tscadc,REG_ADCFSM , ®);if (reg &SEQ_STATUS ) { - tsadc->adc_waiting = true; -prepare_to_wait (&tsadc->reg_se_wait, &wait, + tscadc->adc_waiting = true; +prepare_to_wait (&tscadc->reg_se_wait, &wait,TASK_UNINTERRUPTIBLE ); -spin_unlock_irq (&tsadc->reg_lock); +spin_unlock_irq (&tscadc->reg_lock);schedule (); -spin_lock_irq (&tsadc->reg_lock); -finish_wait (&tsadc->reg_se_wait, &wait); +spin_lock_irq (&tscadc->reg_lock); +finish_wait (&tscadc->reg_se_wait, &wait);/* * Sequencer should either be idle or * busy applying the charge step. */ -regmap_read (tsadc->regmap_tscadc,REG_ADCFSM , ®); +regmap_read (tscadc->regmap_tscadc,REG_ADCFSM , ®);WARN_ON ((reg &SEQ_STATUS ) && !(reg &CHARGE_STEP )); - tsadc->adc_waiting = false; + tscadc->adc_waiting = false; } - tsadc->adc_in_use = true; + tscadc->adc_in_use = true; } -void am335x_tsc_se_set_once (struct ti_tscadc_dev *tsadc,u32 val) +void am335x_tsc_se_set_once (struct ti_tscadc_dev *tscadc,u32 val) { -spin_lock_irq (&tsadc->reg_lock); -am335x_tscadc_need_adc (tsadc); +spin_lock_irq (&tscadc->reg_lock); +am335x_tscadc_need_adc (tscadc); -regmap_write (tsadc->regmap_tscadc,REG_SE , val); -spin_unlock_irq (&tsadc->reg_lock); +regmap_write (tscadc->regmap_tscadc,REG_SE , val); +spin_unlock_irq (&tscadc->reg_lock); }EXPORT_SYMBOL_GPL (am335x_tsc_se_set_once); -void am335x_tsc_se_adc_done (struct ti_tscadc_dev *tsadc) +void am335x_tsc_se_adc_done (struct ti_tscadc_dev *tscadc) {unsigned long flags; -spin_lock_irqsave (&tsadc->reg_lock, flags); - tsadc->adc_in_use = false; -regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache); -spin_unlock_irqrestore (&tsadc->reg_lock, flags); +spin_lock_irqsave (&tscadc->reg_lock, flags); + tscadc->adc_in_use = false; +regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); +spin_unlock_irqrestore (&tscadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_adc_done); -void am335x_tsc_se_clr (struct ti_tscadc_dev *tsadc,u32 val) +void am335x_tsc_se_clr (struct ti_tscadc_dev *tscadc,u32 val) {unsigned long flags; -spin_lock_irqsave (&tsadc->reg_lock, flags); - tsadc->reg_se_cache &= ~val; -regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache); -spin_unlock_irqrestore (&tsadc->reg_lock, flags); +spin_lock_irqsave (&tscadc->reg_lock, flags); + tscadc->reg_se_cache &= ~val; +regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); +spin_unlock_irqrestore (&tscadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_clr); -static void tscadc_idle_config (struct ti_tscadc_dev *config) +static void tscadc_idle_config (struct ti_tscadc_dev *tscadc) {unsigned int idleconfig; idleconfig =STEPCONFIG_YNN |STEPCONFIG_INM_ADCREFM |STEPCONFIG_INP_ADCREFM |STEPCONFIG_YPN ; -regmap_write (config->regmap_tscadc,REG_IDLECONFIG , idleconfig); +regmap_write (tscadc->regmap_tscadc,REG_IDLECONFIG , idleconfig); }static int ti_tscadc_probe (struct platform_device *pdev)@@ -298,9 +298,9 @@ static int ti_tscadc_remove(struct platform_device *pdev)static int __maybe_unused tscadc_suspend (struct device *dev) { -struct ti_tscadc_dev *tscadc_dev =dev_get_drvdata (dev); +struct ti_tscadc_dev *tscadc =dev_get_drvdata (dev); -regmap_write (tscadc_dev->regmap_tscadc,REG_SE ,0x00 ); +regmap_write (tscadc->regmap_tscadc,REG_SE ,0x00 );pm_runtime_put_sync (dev);return 0 ;@@ -308,26 +308,26 @@ static int __maybe_unused tscadc_suspend(struct device *dev)static int __maybe_unused tscadc_resume (struct device *dev) { -struct ti_tscadc_dev *tscadc_dev =dev_get_drvdata (dev); +struct ti_tscadc_dev *tscadc =dev_get_drvdata (dev);u32 ctrl;pm_runtime_get_sync (dev);/* context restore */ ctrl =CNTRLREG_STEPCONFIGWRT |CNTRLREG_STEPID ; -regmap_write (tscadc_dev->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); -if (tscadc_dev->tsc_cell !=-1 ) { -if (tscadc_dev->tsc_wires ==5 ) +if (tscadc->tsc_cell !=-1 ) { +if (tscadc->tsc_wires ==5 ) ctrl |=CNTRLREG_5WIRE |CNTRLREG_TSCENB ;else ctrl |=CNTRLREG_4WIRE |CNTRLREG_TSCENB ; -tscadc_idle_config (tscadc_dev); +tscadc_idle_config (tscadc); } ctrl |=CNTRLREG_TSCSSENB ; -regmap_write (tscadc_dev->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); -regmap_write (tscadc_dev->regmap_tscadc,REG_CLKDIV , tscadc_dev->clk_div); +regmap_write (tscadc->regmap_tscadc,REG_CLKDIV , tscadc->clk_div);return 0 ; }
Re: [PATCH 4/8] mfd: ti_am335x_tscadc: Unify variable naming when refrencing ti_tscadc_dev
In reply to Andrew F. DavisQuoted 8 lines · Andrew F. Davis
All functions in this driver reference the same
ti_tscadc_devper device but use several different names for this structure pointer, this can be confusing when following the code. Use the name 'tscadc' everywhere.Signed-off-by Andrew F. Davis <[email protected]>--- drivers/mfd/ti_am335x_tscadc.c | 88 +++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 44 deletions(-)
Quoted 175 lines
drivers/mfd/ti_am335x_tscadc.c +44
-44@@ -34,89 +34,89 @@ static const struct regmap_config tscadc_regmap_config = { .val_bits = 32, }; -void am335x_tsc_se_set_cache (struct ti_tscadc_dev *tsadc,u32 val) +void am335x_tsc_se_set_cache (struct ti_tscadc_dev *tscadc,u32 val) {unsigned long flags; -spin_lock_irqsave (&tsadc->reg_lock, flags); - tsadc->reg_se_cache |= val; -if (tsadc->adc_waiting) -wake_up (&tsadc->reg_se_wait); -else if (!tsadc->adc_in_use) -regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache); +spin_lock_irqsave (&tscadc->reg_lock, flags); + tscadc->reg_se_cache |= val; +if (tscadc->adc_waiting) +wake_up (&tscadc->reg_se_wait); +else if (!tscadc->adc_in_use) +regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); -spin_unlock_irqrestore (&tsadc->reg_lock, flags); +spin_unlock_irqrestore (&tscadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_set_cache); -static void am335x_tscadc_need_adc (struct ti_tscadc_dev *tsadc) +static void am335x_tscadc_need_adc (struct ti_tscadc_dev *tscadc) {DEFINE_WAIT (wait);u32 reg; -regmap_read (tsadc->regmap_tscadc,REG_ADCFSM , ®); +regmap_read (tscadc->regmap_tscadc,REG_ADCFSM , ®);if (reg &SEQ_STATUS ) { - tsadc->adc_waiting = true; -prepare_to_wait (&tsadc->reg_se_wait, &wait, + tscadc->adc_waiting = true; +prepare_to_wait (&tscadc->reg_se_wait, &wait,TASK_UNINTERRUPTIBLE ); -spin_unlock_irq (&tsadc->reg_lock); +spin_unlock_irq (&tscadc->reg_lock);schedule (); -spin_lock_irq (&tsadc->reg_lock); -finish_wait (&tsadc->reg_se_wait, &wait); +spin_lock_irq (&tscadc->reg_lock); +finish_wait (&tscadc->reg_se_wait, &wait);/* * Sequencer should either be idle or * busy applying the charge step. */ -regmap_read (tsadc->regmap_tscadc,REG_ADCFSM , ®); +regmap_read (tscadc->regmap_tscadc,REG_ADCFSM , ®);WARN_ON ((reg &SEQ_STATUS ) && !(reg &CHARGE_STEP )); - tsadc->adc_waiting = false; + tscadc->adc_waiting = false; } - tsadc->adc_in_use = true; + tscadc->adc_in_use = true; } -void am335x_tsc_se_set_once (struct ti_tscadc_dev *tsadc,u32 val) +void am335x_tsc_se_set_once (struct ti_tscadc_dev *tscadc,u32 val) { -spin_lock_irq (&tsadc->reg_lock); -am335x_tscadc_need_adc (tsadc); +spin_lock_irq (&tscadc->reg_lock); +am335x_tscadc_need_adc (tscadc); -regmap_write (tsadc->regmap_tscadc,REG_SE , val); -spin_unlock_irq (&tsadc->reg_lock); +regmap_write (tscadc->regmap_tscadc,REG_SE , val); +spin_unlock_irq (&tscadc->reg_lock); }EXPORT_SYMBOL_GPL (am335x_tsc_se_set_once); -void am335x_tsc_se_adc_done (struct ti_tscadc_dev *tsadc) +void am335x_tsc_se_adc_done (struct ti_tscadc_dev *tscadc) {unsigned long flags; -spin_lock_irqsave (&tsadc->reg_lock, flags); - tsadc->adc_in_use = false; -regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache); -spin_unlock_irqrestore (&tsadc->reg_lock, flags); +spin_lock_irqsave (&tscadc->reg_lock, flags); + tscadc->adc_in_use = false; +regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); +spin_unlock_irqrestore (&tscadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_adc_done); -void am335x_tsc_se_clr (struct ti_tscadc_dev *tsadc,u32 val) +void am335x_tsc_se_clr (struct ti_tscadc_dev *tscadc,u32 val) {unsigned long flags; -spin_lock_irqsave (&tsadc->reg_lock, flags); - tsadc->reg_se_cache &= ~val; -regmap_write (tsadc->regmap_tscadc,REG_SE , tsadc->reg_se_cache); -spin_unlock_irqrestore (&tsadc->reg_lock, flags); +spin_lock_irqsave (&tscadc->reg_lock, flags); + tscadc->reg_se_cache &= ~val; +regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); +spin_unlock_irqrestore (&tscadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_clr); -static void tscadc_idle_config (struct ti_tscadc_dev *config) +static void tscadc_idle_config (struct ti_tscadc_dev *tscadc) {unsigned int idleconfig; idleconfig =STEPCONFIG_YNN |STEPCONFIG_INM_ADCREFM |STEPCONFIG_INP_ADCREFM |STEPCONFIG_YPN ; -regmap_write (config->regmap_tscadc,REG_IDLECONFIG , idleconfig); +regmap_write (tscadc->regmap_tscadc,REG_IDLECONFIG , idleconfig); }static int ti_tscadc_probe (struct platform_device *pdev)@@ -298,9 +298,9 @@ static int ti_tscadc_remove(struct platform_device *pdev)static int __maybe_unused tscadc_suspend (struct device *dev) { -struct ti_tscadc_dev *tscadc_dev =dev_get_drvdata (dev); +struct ti_tscadc_dev *tscadc =dev_get_drvdata (dev); -regmap_write (tscadc_dev->regmap_tscadc,REG_SE ,0x00 ); +regmap_write (tscadc->regmap_tscadc,REG_SE ,0x00 );pm_runtime_put_sync (dev);return 0 ;@@ -308,26 +308,26 @@ static int __maybe_unused tscadc_suspend(struct device *dev)static int __maybe_unused tscadc_resume (struct device *dev) { -struct ti_tscadc_dev *tscadc_dev =dev_get_drvdata (dev); +struct ti_tscadc_dev *tscadc =dev_get_drvdata (dev);u32 ctrl;pm_runtime_get_sync (dev);/* context restore */ ctrl =CNTRLREG_STEPCONFIGWRT |CNTRLREG_STEPID ; -regmap_write (tscadc_dev->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); -if (tscadc_dev->tsc_cell !=-1 ) { -if (tscadc_dev->tsc_wires ==5 ) +if (tscadc->tsc_cell !=-1 ) { +if (tscadc->tsc_wires ==5 ) ctrl |=CNTRLREG_5WIRE |CNTRLREG_TSCENB ;else ctrl |=CNTRLREG_4WIRE |CNTRLREG_TSCENB ; -tscadc_idle_config (tscadc_dev); +tscadc_idle_config (tscadc); } ctrl |=CNTRLREG_TSCSSENB ; -regmap_write (tscadc_dev->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); -regmap_write (tscadc_dev->regmap_tscadc,REG_CLKDIV , tscadc_dev->clk_div); +regmap_write (tscadc->regmap_tscadc,REG_CLKDIV , tscadc->clk_div);return 0 ; }
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 5/8 mfd: ti_am335x_tscadc: Rename regmap_tscadc to regmap
In reply to Andrew F. DavisThe regmap structuer pointer is named regmap_tscadc, this is not consistent with other drivers and is redundant, it also contributes to several checkpatch warnings involving long lines. Rename this.
--- drivers/mfd/ti_am335x_tscadc.c | 36 ++++++++++++++++++------------------ include/linux/mfd/ti_am335x_tscadc.h | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-)
drivers/mfd/ti_am335x_tscadc.c +18 -18
@@ -43,7 +43,7 @@ void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tscadc, u32 val)if (tscadc->adc_waiting)wake_up (&tscadc->reg_se_wait);else if (!tscadc->adc_in_use) -regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); +regmap_write (tscadc->regmap,REG_SE , tscadc->reg_se_cache);spin_unlock_irqrestore (&tscadc->reg_lock, flags); }
@@ -54,7 +54,7 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tscadc)DEFINE_WAIT (wait);u32 reg; -regmap_read (tscadc->regmap_tscadc,REG_ADCFSM , ®); +regmap_read (tscadc->regmap,REG_ADCFSM , ®);if (reg &SEQ_STATUS ) { tscadc->adc_waiting = true; prepare_to_wait(&tscadc->reg_se_wait, &wait,
@@ -70,7 +70,7 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tscadc)* Sequencer should either be idle or * busy applying the charge step. */ -regmap_read (tscadc->regmap_tscadc,REG_ADCFSM , ®); +regmap_read (tscadc->regmap,REG_ADCFSM , ®);WARN_ON ((reg &SEQ_STATUS ) && !(reg &CHARGE_STEP )); tscadc->adc_waiting = false; }
@@ -82,7 +82,7 @@ void am335x_tsc_se_set_once(struct ti_tscadc_dev *tscadc, u32 val)spin_lock_irq (&tscadc->reg_lock);am335x_tscadc_need_adc (tscadc); -regmap_write (tscadc->regmap_tscadc,REG_SE , val); +regmap_write (tscadc->regmap,REG_SE , val);spin_unlock_irq (&tscadc->reg_lock); }EXPORT_SYMBOL_GPL (am335x_tsc_se_set_once);
@@ -93,7 +93,7 @@ void am335x_tsc_se_adc_done(struct ti_tscadc_dev *tscadc)spin_lock_irqsave (&tscadc->reg_lock, flags); tscadc->adc_in_use = false; -regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); +regmap_write (tscadc->regmap,REG_SE , tscadc->reg_se_cache);spin_unlock_irqrestore (&tscadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_adc_done);
@@ -104,7 +104,7 @@ void am335x_tsc_se_clr(struct ti_tscadc_dev *tscadc, u32 val)spin_lock_irqsave (&tscadc->reg_lock, flags); tscadc->reg_se_cache &= ~val; -regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); +regmap_write (tscadc->regmap,REG_SE , tscadc->reg_se_cache);spin_unlock_irqrestore (&tscadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_clr);
@@ -116,7 +116,7 @@ static void tscadc_idle_config(struct ti_tscadc_dev *tscadc) idleconfig =STEPCONFIG_YNN |STEPCONFIG_INM_ADCREFM |STEPCONFIG_INP_ADCREFM |STEPCONFIG_YPN ; -regmap_write (tscadc->regmap_tscadc,REG_IDLECONFIG , idleconfig); +regmap_write (tscadc->regmap,REG_IDLECONFIG , idleconfig); }static int ti_tscadc_probe (struct platform_device *pdev)
@@ -188,11 +188,11 @@ static int ti_tscadc_probe(struct platform_device *pdev)if (IS_ERR (tscadc->tscadc_base))return PTR_ERR (tscadc->tscadc_base); - tscadc->regmap_tscadc =devm_regmap_init_mmio (&pdev->dev, + tscadc->regmap =devm_regmap_init_mmio (&pdev->dev, tscadc->tscadc_base, &tscadc_regmap_config); -if (IS_ERR (tscadc->regmap_tscadc)) { +if (IS_ERR (tscadc->regmap)) {dev_err (&pdev->dev,"regmap init failed\n" ); - err =PTR_ERR (tscadc->regmap_tscadc); + err =PTR_ERR (tscadc->regmap); goto ret; }
@@ -222,11 +222,11 @@ static int ti_tscadc_probe(struct platform_device *pdev)/* TSCADC_CLKDIV needs to be configured to the value minus 1 */ tscadc->clk_div--; -regmap_write (tscadc->regmap_tscadc,REG_CLKDIV , tscadc->clk_div); +regmap_write (tscadc->regmap,REG_CLKDIV , tscadc->clk_div);/* Set the control register bits */ ctrl =CNTRLREG_STEPCONFIGWRT |CNTRLREG_STEPID ; -regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap,REG_CTRL , ctrl);/* Set register bits for Idle Config Mode */ if (tsc_wires >0 ) {
@@ -240,7 +240,7 @@ static int ti_tscadc_probe(struct platform_device *pdev)/* Enable the TSC module enable bit */ ctrl |=CNTRLREG_TSCSSENB ; -regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap,REG_CTRL , ctrl); tscadc->used_cells =0 ; tscadc->tsc_cell =-1 ;
@@ -286,7 +286,7 @@ static int ti_tscadc_remove(struct platform_device *pdev) {struct ti_tscadc_dev *tscadc =platform_get_drvdata (pdev); -regmap_write (tscadc->regmap_tscadc,REG_SE ,0x00 ); +regmap_write (tscadc->regmap,REG_SE ,0x00 );pm_runtime_put_sync (&pdev->dev);pm_runtime_disable (&pdev->dev);
@@ -300,7 +300,7 @@ static int __maybe_unused tscadc_suspend(struct device *dev) {struct ti_tscadc_dev *tscadc =dev_get_drvdata (dev); -regmap_write (tscadc->regmap_tscadc,REG_SE ,0x00 ); +regmap_write (tscadc->regmap,REG_SE ,0x00 );pm_runtime_put_sync (dev);return 0 ;
@@ -315,7 +315,7 @@ static int __maybe_unused tscadc_resume(struct device *dev)/* context restore */ ctrl =CNTRLREG_STEPCONFIGWRT |CNTRLREG_STEPID ; -regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap,REG_CTRL , ctrl);if (tscadc->tsc_cell !=-1 ) {if (tscadc->tsc_wires ==5 )
@@ -325,9 +325,9 @@ static int __maybe_unused tscadc_resume(struct device *dev)tscadc_idle_config (tscadc); } ctrl |=CNTRLREG_TSCSSENB ; -regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap,REG_CTRL , ctrl); -regmap_write (tscadc->regmap_tscadc,REG_CLKDIV , tscadc->clk_div); +regmap_write (tscadc->regmap,REG_CLKDIV , tscadc->clk_div);return 0 ; }
include/linux/mfd/ti_am335x_tscadc.h +1 -1
@@ -153,7 +153,7 @@struct ti_tscadc_dev {struct device *dev; -struct regmap *regmap_tscadc; +struct regmap *regmap;void __iomem *tscadc_base;int irq;int used_cells;/* 1-2 */
Signature · 1 line
2.8.3
Re: [PATCH 5/8] mfd: ti_am335x_tscadc: Rename regmap_tscadc to regmap
Quoted 3 lines · Andrew F. Davis
The regmap structuer pointer is named
regmap_tscadc, this is not consistent with other drivers and is redundant, it also contributes to several checkpatch warnings involving long lines. Rename this.
Please spell check all of your subject lines and commit logs *before* sending.
Quoted 5 lines
Signed-off-by Andrew F. Davis <[email protected]>--- drivers/mfd/ti_am335x_tscadc.c | 36 ++++++++++++++++++------------------ include/linux/mfd/ti_am335x_tscadc.h | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-)
For the patch:
Quoted 157 lines
drivers/mfd/ti_am335x_tscadc.c +18
-18@@ -43,7 +43,7 @@ void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tscadc, u32 val)if (tscadc->adc_waiting)wake_up (&tscadc->reg_se_wait);else if (!tscadc->adc_in_use) -regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); +regmap_write (tscadc->regmap,REG_SE , tscadc->reg_se_cache);spin_unlock_irqrestore (&tscadc->reg_lock, flags); }@@ -54,7 +54,7 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tscadc)DEFINE_WAIT (wait);u32 reg; -regmap_read (tscadc->regmap_tscadc,REG_ADCFSM , ®); +regmap_read (tscadc->regmap,REG_ADCFSM , ®);if (reg &SEQ_STATUS ) { tscadc->adc_waiting = true; prepare_to_wait(&tscadc->reg_se_wait, &wait,@@ -70,7 +70,7 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tscadc)* Sequencer should either be idle or * busy applying the charge step. */ -regmap_read (tscadc->regmap_tscadc,REG_ADCFSM , ®); +regmap_read (tscadc->regmap,REG_ADCFSM , ®);WARN_ON ((reg &SEQ_STATUS ) && !(reg &CHARGE_STEP )); tscadc->adc_waiting = false; }@@ -82,7 +82,7 @@ void am335x_tsc_se_set_once(struct ti_tscadc_dev *tscadc, u32 val)spin_lock_irq (&tscadc->reg_lock);am335x_tscadc_need_adc (tscadc); -regmap_write (tscadc->regmap_tscadc,REG_SE , val); +regmap_write (tscadc->regmap,REG_SE , val);spin_unlock_irq (&tscadc->reg_lock); }EXPORT_SYMBOL_GPL (am335x_tsc_se_set_once);@@ -93,7 +93,7 @@ void am335x_tsc_se_adc_done(struct ti_tscadc_dev *tscadc)spin_lock_irqsave (&tscadc->reg_lock, flags); tscadc->adc_in_use = false; -regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); +regmap_write (tscadc->regmap,REG_SE , tscadc->reg_se_cache);spin_unlock_irqrestore (&tscadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_adc_done);@@ -104,7 +104,7 @@ void am335x_tsc_se_clr(struct ti_tscadc_dev *tscadc, u32 val)spin_lock_irqsave (&tscadc->reg_lock, flags); tscadc->reg_se_cache &= ~val; -regmap_write (tscadc->regmap_tscadc,REG_SE , tscadc->reg_se_cache); +regmap_write (tscadc->regmap,REG_SE , tscadc->reg_se_cache);spin_unlock_irqrestore (&tscadc->reg_lock, flags); }EXPORT_SYMBOL_GPL (am335x_tsc_se_clr);@@ -116,7 +116,7 @@ static void tscadc_idle_config(struct ti_tscadc_dev *tscadc) idleconfig =STEPCONFIG_YNN |STEPCONFIG_INM_ADCREFM |STEPCONFIG_INP_ADCREFM |STEPCONFIG_YPN ; -regmap_write (tscadc->regmap_tscadc,REG_IDLECONFIG , idleconfig); +regmap_write (tscadc->regmap,REG_IDLECONFIG , idleconfig); }static int ti_tscadc_probe (struct platform_device *pdev)@@ -188,11 +188,11 @@ static int ti_tscadc_probe(struct platform_device *pdev)if (IS_ERR (tscadc->tscadc_base))return PTR_ERR (tscadc->tscadc_base); - tscadc->regmap_tscadc =devm_regmap_init_mmio (&pdev->dev, + tscadc->regmap =devm_regmap_init_mmio (&pdev->dev, tscadc->tscadc_base, &tscadc_regmap_config); -if (IS_ERR (tscadc->regmap_tscadc)) { +if (IS_ERR (tscadc->regmap)) {dev_err (&pdev->dev,"regmap init failed\n" ); - err =PTR_ERR (tscadc->regmap_tscadc); + err =PTR_ERR (tscadc->regmap); goto ret; }@@ -222,11 +222,11 @@ static int ti_tscadc_probe(struct platform_device *pdev)/* TSCADC_CLKDIV needs to be configured to the value minus 1 */ tscadc->clk_div--; -regmap_write (tscadc->regmap_tscadc,REG_CLKDIV , tscadc->clk_div); +regmap_write (tscadc->regmap,REG_CLKDIV , tscadc->clk_div);/* Set the control register bits */ ctrl =CNTRLREG_STEPCONFIGWRT |CNTRLREG_STEPID ; -regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap,REG_CTRL , ctrl);/* Set register bits for Idle Config Mode */ if (tsc_wires >0 ) {@@ -240,7 +240,7 @@ static int ti_tscadc_probe(struct platform_device *pdev)/* Enable the TSC module enable bit */ ctrl |=CNTRLREG_TSCSSENB ; -regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap,REG_CTRL , ctrl); tscadc->used_cells =0 ; tscadc->tsc_cell =-1 ;@@ -286,7 +286,7 @@ static int ti_tscadc_remove(struct platform_device *pdev) {struct ti_tscadc_dev *tscadc =platform_get_drvdata (pdev); -regmap_write (tscadc->regmap_tscadc,REG_SE ,0x00 ); +regmap_write (tscadc->regmap,REG_SE ,0x00 );pm_runtime_put_sync (&pdev->dev);pm_runtime_disable (&pdev->dev);@@ -300,7 +300,7 @@ static int __maybe_unused tscadc_suspend(struct device *dev) {struct ti_tscadc_dev *tscadc =dev_get_drvdata (dev); -regmap_write (tscadc->regmap_tscadc,REG_SE ,0x00 ); +regmap_write (tscadc->regmap,REG_SE ,0x00 );pm_runtime_put_sync (dev);return 0 ;@@ -315,7 +315,7 @@ static int __maybe_unused tscadc_resume(struct device *dev)/* context restore */ ctrl =CNTRLREG_STEPCONFIGWRT |CNTRLREG_STEPID ; -regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap,REG_CTRL , ctrl);if (tscadc->tsc_cell !=-1 ) {if (tscadc->tsc_wires ==5 )@@ -325,9 +325,9 @@ static int __maybe_unused tscadc_resume(struct device *dev)tscadc_idle_config (tscadc); } ctrl |=CNTRLREG_TSCSSENB ; -regmap_write (tscadc->regmap_tscadc,REG_CTRL , ctrl); +regmap_write (tscadc->regmap,REG_CTRL , ctrl); -regmap_write (tscadc->regmap_tscadc,REG_CLKDIV , tscadc->clk_div); +regmap_write (tscadc->regmap,REG_CLKDIV , tscadc->clk_div);return 0 ; }include/linux/mfd/ti_am335x_tscadc.h +1
-1@@ -153,7 +153,7 @@struct ti_tscadc_dev {struct device *dev; -struct regmap *regmap_tscadc; +struct regmap *regmap;void __iomem *tscadc_base;int irq;int used_cells;/* 1-2 */
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 6/8 mfd: ti_am335x_tscadc: use variable name for sizeof() operator
In reply to Andrew F. DavisFix the code formatting to use the kernel preferred style of using the actual variables to determize the size using the sizeof() operator.
--- drivers/mfd/ti_am335x_tscadc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mfd/ti_am335x_tscadc.c +1 -2
@@ -168,8 +168,7 @@ static int ti_tscadc_probe(struct platform_device *pdev) }/* Allocate memory for device */ - tscadc =devm_kzalloc (&pdev->dev, -sizeof (struct ti_tscadc_dev ),GFP_KERNEL ); + tscadc =devm_kzalloc (&pdev->dev,sizeof (*tscadc),GFP_KERNEL );if (!tscadc) {dev_err (&pdev->dev,"failed to allocate memory.\n" );return -ENOMEM ;
Signature · 1 line
2.8.3
Re: [PATCH 6/8] mfd: ti_am335x_tscadc: use variable name for sizeof() operator
Quoted 8 lines · Andrew F. Davis
Fix the code formatting to use the kernel preferred style of using the actual variables to determize the size using the
sizeof()operator.Signed-off-by Andrew F. Davis <[email protected]>--- drivers/mfd/ti_am335x_tscadc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 14 lines
drivers/mfd/ti_am335x_tscadc.c +1
-2@@ -168,8 +168,7 @@ static int ti_tscadc_probe(struct platform_device *pdev) }/* Allocate memory for device */ - tscadc =devm_kzalloc (&pdev->dev, -sizeof (struct ti_tscadc_dev ),GFP_KERNEL ); + tscadc =devm_kzalloc (&pdev->dev,sizeof (*tscadc),GFP_KERNEL );if (!tscadc) {dev_err (&pdev->dev,"failed to allocate memory.\n" );return -ENOMEM ;
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 7/8 iio: adc: ti_am335x_adc: use variable names for sizeof() operator
In reply to Andrew F. DavisFix the code formatting to use the kernel preferred style of using the actual variables to determize the size using the sizeof() operator.
--- drivers/iio/adc/ti_am335x_adc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/iio/adc/ti_am335x_adc.c +2 -4
@@ -326,8 +326,7 @@ static int tiadc_channel_init(struct iio_dev *indio_dev, int channels)int i; indio_dev->num_channels = channels; - chan_array =kcalloc (channels, -sizeof (struct iio_chan_spec ),GFP_KERNEL ); + chan_array =kcalloc (channels,sizeof (*chan_array),GFP_KERNEL );if (chan_array ==NULL )return -ENOMEM ;
@@ -467,8 +466,7 @@ static int tiadc_probe(struct platform_device *pdev)return -EINVAL ; } - indio_dev =devm_iio_device_alloc (&pdev->dev, -sizeof (struct tiadc_device )); + indio_dev =devm_iio_device_alloc (&pdev->dev,sizeof (*indio_dev));if (indio_dev ==NULL ) {dev_err (&pdev->dev,"failed to allocate iio device\n" );return -ENOMEM ;
Signature · 1 line
2.8.3
Jonathan Cameron
maintainerRe: [PATCH 7/8] iio: adc: ti_am335x_adc: use variable names for sizeof() operator
Quoted 5 lines · Andrew F. Davis
Fix the code formatting to use the kernel preferred style of using the actual variables to determize the size using the
sizeof()operator.Signed-off-by Andrew F. Davis <[email protected]>
Applied - thanks,
Jonathan
Quoted 29 lines
--- drivers/iio/adc/ti_am335x_adc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/iio/adc/ti_am335x_adc.c +2
-4@@ -326,8 +326,7 @@ static int tiadc_channel_init(struct iio_dev *indio_dev, int channels)int i; indio_dev->num_channels = channels; - chan_array =kcalloc (channels, -sizeof (struct iio_chan_spec ),GFP_KERNEL ); + chan_array =kcalloc (channels,sizeof (*chan_array),GFP_KERNEL );if (chan_array ==NULL )return -ENOMEM ;@@ -467,8 +466,7 @@ static int tiadc_probe(struct platform_device *pdev)return -EINVAL ; } - indio_dev =devm_iio_device_alloc (&pdev->dev, -sizeof (struct tiadc_device )); + indio_dev =devm_iio_device_alloc (&pdev->dev,sizeof (*indio_dev));if (indio_dev ==NULL ) {dev_err (&pdev->dev,"failed to allocate iio device\n" );return -ENOMEM ;
PATCH 8/8 Input: ti_am335x_tsc - use variable name for sizeof() operator
In reply to Andrew F. DavisFix the code formatting to use the kernel preferred style of using the actual variables to determize the size using the sizeof() operator.
--- drivers/input/touchscreen/ti_am335x_tsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/ti_am335x_tsc.c +1 -1
@@ -406,7 +406,7 @@ static int titsc_probe(struct platform_device *pdev)int err;/* Allocate memory for device */ - ts_dev =kzalloc (sizeof (struct titsc ),GFP_KERNEL ); + ts_dev =kzalloc (sizeof (*ts_dev),GFP_KERNEL ); input_dev =input_allocate_device ();if (!ts_dev || !input_dev) {dev_err (&pdev->dev,"failed to allocate memory.\n" );
Signature · 1 line
2.8.3
Re: [PATCH 8/8] Input: ti_am335x_tsc - use variable name for sizeof() operator
Quoted 5 lines · Andrew F. Davis
Fix the code formatting to use the kernel preferred style of using the actual variables to determize the size using the
sizeof()operator.Signed-off-by Andrew F. Davis <[email protected]>
Applied, thank you.
Quoted 20 lines
--- drivers/input/touchscreen/ti_am335x_tsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/input/touchscreen/ti_am335x_tsc.c +1
-1@@ -406,7 +406,7 @@ static int titsc_probe(struct platform_device *pdev)int err;/* Allocate memory for device */ - ts_dev =kzalloc (sizeof (struct titsc ),GFP_KERNEL ); + ts_dev =kzalloc (sizeof (*ts_dev),GFP_KERNEL ); input_dev =input_allocate_device ();if (!ts_dev || !input_dev) {dev_err (&pdev->dev,"failed to allocate memory.\n" );Signature · 1 line
2.8.3
Signature · 1 line
Dmitry
Quoted 6 lines · Andrew F. Davis
Hello all,
This series is a group of non-functional changes I would like to get in this cycle to prepare some regmap based changes I would like to make next cycle. Hopefully the churn can be seen as more useful in that case.
Once you've finished spell checking all of your commits, please submit with the Acks you have collected.
Quoted 17 lines
Andrew F. Davis (8):
mfd:ti_am335x_tscadc: UseSIMPLE_DEV_PM_OPShelper macro
iio: adc:ti_am335x_adc: useSIMPLE_DEV_PM_OPShelper macro
mfd:ti_am335x_tscadc: Remove use of single line functions
mfd:ti_am335x_tscadc: Unify variable naming when refrencing
ti_tscadc_dev
mfd:ti_am335x_tscadc: Renameregmap_tscadcto regmap
mfd:ti_am335x_tscadc: use variable name forsizeof()operator
iio: adc:ti_am335x_adc: use variable names forsizeof()operator
Input:ti_am335x_tsc- use variable name forsizeof()operatordrivers/iio/adc/ti_am335x_adc.c | 22 ++--- drivers/input/touchscreen/ti_am335x_tsc.c | 2 +- drivers/mfd/ti_am335x_tscadc.c | 135 +++++++++++++----------------- include/linux/mfd/ti_am335x_tscadc.h | 2 +- 4 files changed, 64 insertions(+), 97 deletions(-)
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog