From 8f99bd636b41b26b3a08f55cfe14ce523ab5a6a4 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Tue, 18 Mar 2014 19:55:46 +0900 Subject: extcon: Move OF helper function to extcon core and change function name This patch move simply OF helper function to extcon core and change function name as following: - of_extcon_get_extcon_dev() -> extcon_get_edev_by_phandle() Signed-off-by: Chanwoo Choi Acked-by: Felipe Balbi (cherry picked from commit 1ad94ffef22c0a6e2ee6ba90a800c32fd29ffa1f) --- include/linux/extcon.h | 12 ++++++++++++ include/linux/extcon/of_extcon.h | 31 ------------------------------- 2 files changed, 12 insertions(+), 31 deletions(-) delete mode 100644 include/linux/extcon/of_extcon.h (limited to 'include') diff --git a/include/linux/extcon.h b/include/linux/extcon.h index 21c59af1150b..f488145bb2d4 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h @@ -240,6 +240,12 @@ extern int extcon_register_notifier(struct extcon_dev *edev, struct notifier_block *nb); extern int extcon_unregister_notifier(struct extcon_dev *edev, struct notifier_block *nb); + +/* + * Following API get the extcon device from devicetree. + * This function use phandle of devicetree to get extcon device directly. + */ +extern struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index); #else /* CONFIG_EXTCON */ static inline int extcon_dev_register(struct extcon_dev *edev) { @@ -324,5 +330,11 @@ static inline int extcon_unregister_interest(struct extcon_specific_cable_nb { return 0; } + +static inline struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, + int index) +{ + return ERR_PTR(-ENODEV); +} #endif /* CONFIG_EXTCON */ #endif /* __LINUX_EXTCON_H__ */ diff --git a/include/linux/extcon/of_extcon.h b/include/linux/extcon/of_extcon.h deleted file mode 100644 index 0ebfeff1b55d..000000000000 --- a/include/linux/extcon/of_extcon.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * OF helpers for External connector (extcon) framework - * - * Copyright (C) 2013 Texas Instruments, Inc. - * Kishon Vijay Abraham I - * - * Copyright (C) 2013 Samsung Electronics - * Chanwoo Choi - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#ifndef __LINUX_OF_EXTCON_H -#define __LINUX_OF_EXTCON_H - -#include - -#if IS_ENABLED(CONFIG_OF_EXTCON) -extern struct extcon_dev - *of_extcon_get_extcon_dev(struct device *dev, int index); -#else -static inline struct extcon_dev - *of_extcon_get_extcon_dev(struct device *dev, int index) -{ - return ERR_PTR(-ENOSYS); -} -#endif /* CONFIG_OF_EXTCON */ -#endif /* __LINUX_OF_EXTCON_H */ -- cgit v1.2.3