* [PATCH] extcon: Add stubs for extcon_register_notifier_all() functions
@ 2020-12-31 8:52 Krzysztof Kozlowski
2021-01-04 10:32 ` Chanwoo Choi
0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2020-12-31 8:52 UTC (permalink / raw)
To: MyungJoo Ham, Chanwoo Choi, Hans de Goede, linux-kernel
Cc: Timon Baetz, kbuild-all, Lee Jones, Sebastian Reichel,
Krzysztof Kozlowski, kernel test robot
Add stubs for extcon_register_notifier_all() function for !CONFIG_EXTCON
case. This is useful for compile testing and for drivers which use
EXTCON but do not require it (therefore do not depend on CONFIG_EXTCON).
Fixes: 815429b39d94 ("extcon: Add new extcon_register_notifier_all() to monitor all external connectors")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
include/linux/extcon.h | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index fd183fb9c20f..0c19010da77f 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -271,6 +271,29 @@ static inline void devm_extcon_unregister_notifier(struct device *dev,
struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb) { }
+static inline int extcon_register_notifier_all(struct extcon_dev *edev,
+ struct notifier_block *nb)
+{
+ return 0;
+}
+
+static inline int extcon_unregister_notifier_all(struct extcon_dev *edev,
+ struct notifier_block *nb)
+{
+ return 0;
+}
+
+static inline int devm_extcon_register_notifier_all(struct device *dev,
+ struct extcon_dev *edev,
+ struct notifier_block *nb)
+{
+ return 0;
+}
+
+static inline void devm_extcon_unregister_notifier_all(struct device *dev,
+ struct extcon_dev *edev,
+ struct notifier_block *nb) { }
+
static inline struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name)
{
return ERR_PTR(-ENODEV);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] extcon: Add stubs for extcon_register_notifier_all() functions
2020-12-31 8:52 [PATCH] extcon: Add stubs for extcon_register_notifier_all() functions Krzysztof Kozlowski
@ 2021-01-04 10:32 ` Chanwoo Choi
0 siblings, 0 replies; 2+ messages in thread
From: Chanwoo Choi @ 2021-01-04 10:32 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: MyungJoo Ham, Chanwoo Choi, Hans de Goede, linux-kernel,
Timon Baetz, kbuild-all, Lee Jones, Sebastian Reichel,
kernel test robot
Hi Krzysztof,
On Thu, Dec 31, 2020 at 5:56 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> Add stubs for extcon_register_notifier_all() function for !CONFIG_EXTCON
> case. This is useful for compile testing and for drivers which use
> EXTCON but do not require it (therefore do not depend on CONFIG_EXTCON).
>
> Fixes: 815429b39d94 ("extcon: Add new extcon_register_notifier_all() to monitor all external connectors")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
> include/linux/extcon.h | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/include/linux/extcon.h b/include/linux/extcon.h
> index fd183fb9c20f..0c19010da77f 100644
> --- a/include/linux/extcon.h
> +++ b/include/linux/extcon.h
> @@ -271,6 +271,29 @@ static inline void devm_extcon_unregister_notifier(struct device *dev,
> struct extcon_dev *edev, unsigned int id,
> struct notifier_block *nb) { }
>
> +static inline int extcon_register_notifier_all(struct extcon_dev *edev,
> + struct notifier_block *nb)
> +{
> + return 0;
> +}
> +
> +static inline int extcon_unregister_notifier_all(struct extcon_dev *edev,
> + struct notifier_block *nb)
> +{
> + return 0;
> +}
> +
> +static inline int devm_extcon_register_notifier_all(struct device *dev,
> + struct extcon_dev *edev,
> + struct notifier_block *nb)
> +{
> + return 0;
> +}
> +
> +static inline void devm_extcon_unregister_notifier_all(struct device *dev,
> + struct extcon_dev *edev,
> + struct notifier_block *nb) { }
> +
> static inline struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name)
> {
> return ERR_PTR(-ENODEV);
> --
> 2.25.1
>
Applied it. Thanks.
--
Best Regards,
Chanwoo Choi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-04 10:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-31 8:52 [PATCH] extcon: Add stubs for extcon_register_notifier_all() functions Krzysztof Kozlowski
2021-01-04 10:32 ` Chanwoo Choi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).