[PATCH v9 6/8] soc/tegra: Add devm_tegra_core_dev_init_opp_table_simple()

From: Dmitry Osipenko
Date: Thu Aug 26 2021 - 21:38:12 EST


Only couple drivers need to get the -ENODEV error code and explicitly
initialize the performance state. Add new helper that allows to avoid
the extra boilerplate code in majority of drivers.

Signed-off-by: Dmitry Osipenko <digetx@xxxxxxxxx>
---
include/soc/tegra/common.h | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/include/soc/tegra/common.h b/include/soc/tegra/common.h
index af41ad80ec21..265ad90e45a2 100644
--- a/include/soc/tegra/common.h
+++ b/include/soc/tegra/common.h
@@ -39,4 +39,17 @@ devm_tegra_core_dev_init_opp_table(struct device *dev,
}
#endif

+static inline int
+devm_tegra_core_dev_init_opp_table_simple(struct device *dev)
+{
+ struct tegra_core_opp_params params = {};
+ int err;
+
+ err = devm_tegra_core_dev_init_opp_table(dev, &params);
+ if (err != -ENODEV)
+ return err;
+
+ return 0;
+}
+
#endif /* __SOC_TEGRA_COMMON_H__ */
--
2.32.0