Input: mt6779-keypad - use devm_clk_get_enabled()
Subsystems (4)
Dmitry Torokhov
maintainerPATCH 1/1 Input: mt6779-keypad - use devm_clk_get_enabled()
Switch to using devm_clk_get_enable() helper instead of acquiring the clock with devm_clk_get(), enabling it, and defining and installing a custom devm action to call clk_disable().
Signed-off-by Dmitry Torokhov <[email protected]>
--- drivers/input/keyboard/mt6779-keypad.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/input/keyboard/mt6779-keypad.c +1 -17
@@ -92,11 +92,6 @@ static irqreturn_t mt6779_keypad_irq_handler(int irq, void *dev_id)return IRQ_HANDLED ; } -static void mt6779_keypad_clk_disable (void *data) -{ -clk_disable_unprepare (data); -} -static void mt6779_keypad_calc_row_col_single (unsigned int key,unsigned int *row,unsigned int *col)
@@ -213,21 +208,10 @@ static int mt6779_keypad_pdrv_probe(struct platform_device *pdev)regmap_update_bits (keypad->regmap,MTK_KPD_SEL ,MTK_KPD_SEL_COL ,MTK_KPD_SEL_COLMASK (keypad->n_cols)); - keypad->clk =devm_clk_get (&pdev->dev,"kpd" ); + keypad->clk =devm_clk_get_enabled (&pdev->dev,"kpd" );if (IS_ERR (keypad->clk))return PTR_ERR (keypad->clk); - error =clk_prepare_enable (keypad->clk); -if (error) { -dev_err (&pdev->dev,"cannot prepare/enable keypad clock\n" ); -return error; - } - - error =devm_add_action_or_reset (&pdev->dev, mt6779_keypad_clk_disable, - keypad->clk); -if (error) -return error; - irq =platform_get_irq (pdev,0 );if (irq <0 )return irq;
Signature · 5 lines
2.46.0.295.g3b9ea8a38a-goog -- Dmitry
Hi Dmitry
Thank you for the patch.
Quoted 5 lines · Dmitry Torokhov
Switch to using
devm_clk_get_enable()helper instead of acquiring the clock withdevm_clk_get(), enabling it, and defining and installing a custom devm action to callclk_disable().Signed-off-by Dmitry Torokhov <[email protected]>
Reviewed-by Mattijs Korpershoek <[email protected]>
Quoted 49 lines
--- drivers/input/keyboard/mt6779-keypad.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-)drivers/input/keyboard/mt6779-keypad.c +1
-17@@ -92,11 +92,6 @@ static irqreturn_t mt6779_keypad_irq_handler(int irq, void *dev_id)return IRQ_HANDLED ; } -static void mt6779_keypad_clk_disable (void *data) -{ -clk_disable_unprepare (data); -} -static void mt6779_keypad_calc_row_col_single (unsigned int key,unsigned int *row,unsigned int *col)@@ -213,21 +208,10 @@ static int mt6779_keypad_pdrv_probe(struct platform_device *pdev)regmap_update_bits (keypad->regmap,MTK_KPD_SEL ,MTK_KPD_SEL_COL ,MTK_KPD_SEL_COLMASK (keypad->n_cols)); - keypad->clk =devm_clk_get (&pdev->dev,"kpd" ); + keypad->clk =devm_clk_get_enabled (&pdev->dev,"kpd" );if (IS_ERR (keypad->clk))return PTR_ERR (keypad->clk); - error =clk_prepare_enable (keypad->clk); -if (error) { -dev_err (&pdev->dev,"cannot prepare/enable keypad clock\n" ); -return error; - } - - error =devm_add_action_or_reset (&pdev->dev, mt6779_keypad_clk_disable, - keypad->clk); -if (error) -return error; - irq =platform_get_irq (pdev,0 );if (irq <0 )return irq;Signature · 5 lines
2.46.0.295.g3b9ea8a38a-goog -- Dmitry