[PATCH -next 00/11] mtd: Use devm_clk_get_enabled() to simplify the drivers.

Li Zetao lizetao1 at huawei.com
Wed Aug 16 19:44:58 PDT 2023


Commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared
and enabled clocks") provides a new helper function for prepared and
enabled clocks when a driver keeps a clock prepared (or enabled) during
the whole lifetime of the driver. So where drivers get clocks and enable
them immediately, it can be combined into a single function
devm_clk_get_*enabled(). Moreover, the unprepare and disable function
has been registered to devm_clk_state, and before devm_clk_state is
released, the clocks will be unprepareed and disable, so it is unnecessary
to unprepare and disable clock explicitly when remove drivers or in the
error handling path.

Li Zetao (11):
  mtd: spear_smi: Use helper function devm_clk_get_enabled()
  mtd: rawnand: arasan: Use helper function devm_clk_get_enabled()
  mtd: rawnand: fsmc: Use helper function devm_clk_get_enabled()
  mtd: rawnand: intel: Use helper function devm_clk_get_enabled()
  mtd: rawnand: lpc32xx_slc: Use helper function devm_clk_get_enabled()
  mtd: rawnand: mpc5121: Use helper function devm_clk_get_enabled()
  mtd: rawnand: mtk: Use helper function devm_clk_get_enabled()
  mtd: rawnand: stm32_fmc2: Use helper function devm_clk_get_enabled()
  mtd: rawnand: sunxi: Use helper function devm_clk_get_enabled()
  mtd: rawnand: vf610_nfc: Use helper function devm_clk_get_enabled()
  mtd: spi-nor: Use helper function devm_clk_get_enabled()

 drivers/mtd/devices/spear_smi.c               | 15 ++-------
 drivers/mtd/nand/raw/arasan-nand-controller.c | 29 +++-------------
 drivers/mtd/nand/raw/fsmc_nand.c              |  8 +----
 drivers/mtd/nand/raw/intel-nand-controller.c  | 15 ++-------
 drivers/mtd/nand/raw/lpc32xx_slc.c            | 12 ++-----
 drivers/mtd/nand/raw/mpc5121_nfc.c            | 11 ++-----
 drivers/mtd/nand/raw/mtk_nand.c               | 20 ++++-------
 drivers/mtd/nand/raw/stm32_fmc2_nand.c        | 17 +++-------
 drivers/mtd/nand/raw/sunxi_nand.c             | 29 ++++------------
 drivers/mtd/nand/raw/vf610_nfc.c              | 29 +++++-----------
 drivers/mtd/spi-nor/controllers/nxp-spifi.c   | 33 ++++---------------
 11 files changed, 48 insertions(+), 170 deletions(-)

-- 
2.34.1




More information about the linux-arm-kernel mailing list