projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
235a96e
)
mfd: ti_am335x_tscadc: Simplify divisor calculation
author
Miquel Raynal
<miquel.raynal@bootlin.com>
Fri, 15 Oct 2021 08:14:33 +0000
(10:14 +0200)
committer
Lee Jones
<lee.jones@linaro.org>
Wed, 20 Oct 2021 16:25:15 +0000
(17:25 +0100)
Let's rewrite this on a single line, it does not hurt the readability
and saves a useless temporary variable.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link:
https://lore.kernel.org/r/20211015081506.933180-16-miquel.raynal@bootlin.com
drivers/mfd/ti_am335x_tscadc.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/mfd/ti_am335x_tscadc.c
b/drivers/mfd/ti_am335x_tscadc.c
index 7f7b8e79a7bf8f3cd0cf547c9dcb28c061b3d1fc..20d8ddee27fe0b1087148d7ab54ea58cdbfd951d 100644
(file)
--- a/
drivers/mfd/ti_am335x_tscadc.c
+++ b/
drivers/mfd/ti_am335x_tscadc.c
@@
-122,7
+122,6
@@
static int ti_tscadc_probe(struct platform_device *pdev)
const __be32 *cur;
u32 val;
int err, ctrl;
- int clock_rate;
int tsc_wires = 0, adc_channels = 0, total_channels;
int readouts = 0;
@@
-212,11
+211,8
@@
static int ti_tscadc_probe(struct platform_device *pdev)
err = PTR_ERR(clk);
goto err_disable_clk;
}
- clock_rate = clk_get_rate(clk);
- tscadc->clk_div = clock_rate / ADC_CLK;
- /* TSCADC_CLKDIV needs to be configured to the value minus 1 */
- tscadc->clk_div--;
+ tscadc->clk_div = (clk_get_rate(clk) / ADC_CLK) - 1;
regmap_write(tscadc->regmap, REG_CLKDIV, tscadc->clk_div);
/* Set the control register bits */