From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756043AbcGZMKe (ORCPT ); Tue, 26 Jul 2016 08:10:34 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:42795 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754228AbcGZMJ6 (ORCPT ); Tue, 26 Jul 2016 08:09:58 -0400 X-AuditID: cbfee68e-f79cb6d000006cfe-76-579753138d8b From: Chanwoo Choi To: linux-kernel@vger.kernel.org Cc: cw00.choi@samsung.com, myungjoo.ham@samsung.com, zyw@rock-chips.com, groeck@chromium.org, cwchoi00@gmail.com Subject: [PATCH 4/6] extcon: Rename the extcon_set/get_state() to maintain the function naming pattern Date: Tue, 26 Jul 2016 21:09:46 +0900 Message-id: <1469534988-8305-5-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1469534988-8305-1-git-send-email-cw00.choi@samsung.com> References: <1469534988-8305-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRmVeSWpSXmKPExsWyRsSkUFc4eHq4weYGBYvrX56zWjw7qm1x 6tUyZovLu+awWdxuXMFmMf/BDmYHNo/ZDRdZPHbOusvu8XfWfhaPvi2rGD0+b5ILYI3isklJ zcksSy3St0vgytiwo4Gt4JNqxYnnz1gbGBfKdzFyckgImEh0PN3CBmGLSVy4tx7I5uIQEljB KPHq9UFWmKK/W5tZIRJLGSX+7upkhnC+MEqc2XaKEaSKTUBLYv+LG2CjRAQUJDb3PgPrZhYo klg6/Sc7iC0skCFxrO8+C4jNIqAqcfnNLrAaXgEXia6Dx6HOkJP4sOcRWD2ngKvEtDXbwGwh oJr5+yaCXSEhMJldYln7GqhBAhLfJh8CsjmAErISmw4wQ8yRlDi44gbLBEbhBYwMqxhFUwuS C4qT0ouM9IoTc4tL89L1kvNzNzECg/v0v2d9OxhvHr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Jh5e703/l2+1Zeioz1i+V0zTt88NDB1E0q1o8jDnxs+7uGw05GRKHibsQr 3Yk7jFx3bnr78TfDFKGH57XrDtZUlGjsPi+3rptbiaU4I9FQi7moOBEAGdUGlbYCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch just renames the existing extcon_get/set_cable_state_() as following because of maintaining the function naming pattern like as extcon APIs for property. - extcon_set_cable_state_() -> extcon_set_state() - extcon_get_cable_state_() -> extcon_get_state() But, this patch remains the old extcon_set/get_cable_state_() functions to prevent the build break. After altering new APIs, remove the old APIs. Signed-off-by: Chanwoo Choi --- drivers/extcon/extcon.c | 15 +++++++-------- include/linux/extcon.h | 25 ++++++++++++++++++------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index f9522fcdb99c..73c6981bf559 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -373,8 +373,7 @@ static ssize_t cable_state_show(struct device *dev, int i = cable->cable_index; return sprintf(buf, "%d\n", - extcon_get_cable_state_(cable->edev, - cable->edev->supported_cable[i])); + extcon_get_state(cable->edev, cable->edev->supported_cable[i])); } /** @@ -470,11 +469,11 @@ static int extcon_update_state(struct extcon_dev *edev, u32 mask, u32 state) } /** - * extcon_get_cable_state_() - Get the status of a specific cable. + * extcon_get_state() - Get the state of a external connector. * @edev: the extcon device that has the cable. * @id: the unique id of each external connector in extcon enumeration. */ -int extcon_get_cable_state_(struct extcon_dev *edev, const unsigned int id) +int extcon_get_state(struct extcon_dev *edev, const unsigned int id) { int index; @@ -490,17 +489,17 @@ int extcon_get_cable_state_(struct extcon_dev *edev, const unsigned int id) return (int)(is_extcon_attached(edev, id, index)); } -EXPORT_SYMBOL_GPL(extcon_get_cable_state_); +EXPORT_SYMBOL_GPL(extcon_get_state); /** - * extcon_set_cable_state_() - Set the status of a specific cable. + * extcon_set_state() - Set the state of a external connector. * @edev: the extcon device that has the cable. * @id: the unique id of each external connector * in extcon enumeration. * @state: the new cable status. The default semantics is * true: attached / false: detached. */ -int extcon_set_cable_state_(struct extcon_dev *edev, unsigned int id, +int extcon_set_state(struct extcon_dev *edev, unsigned int id, bool cable_state) { u32 state; @@ -527,7 +526,7 @@ int extcon_set_cable_state_(struct extcon_dev *edev, unsigned int id, state = cable_state ? (1 << index) : 0; return extcon_update_state(edev, 1 << index, state); } -EXPORT_SYMBOL_GPL(extcon_set_cable_state_); +EXPORT_SYMBOL_GPL(extcon_set_state); /** * extcon_get_property() - Get the property value of a specific cable. diff --git a/include/linux/extcon.h b/include/linux/extcon.h index ee34a644594a..26f4481b3788 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h @@ -221,11 +221,11 @@ extern struct extcon_dev *devm_extcon_dev_allocate(struct device *dev, extern void devm_extcon_dev_free(struct device *dev, struct extcon_dev *edev); /* - * get/set_cable_state access each bit of the 32b encoded state value. + * get/set_state access each bit of the 32b encoded state value. * They are used to access the status of each cable based on the cable id. */ -extern int extcon_get_cable_state_(struct extcon_dev *edev, unsigned int id); -extern int extcon_set_cable_state_(struct extcon_dev *edev, unsigned int id, +extern int extcon_get_state(struct extcon_dev *edev, unsigned int id); +extern int extcon_set_state(struct extcon_dev *edev, unsigned int id, bool cable_state); /* @@ -310,14 +310,14 @@ static inline struct extcon_dev *devm_extcon_dev_allocate(struct device *dev, static inline void devm_extcon_dev_free(struct extcon_dev *edev) { } -static inline int extcon_get_cable_state_(struct extcon_dev *edev, - unsigned int id) + +static inline int extcon_get_state(struct extcon_dev *edev, unsigned int id) { return 0; } -static inline int extcon_set_cable_state_(struct extcon_dev *edev, - unsigned int id, bool cable_state) +static inline int extcon_set_state(struct extcon_dev *edev, unsigned int id, + bool cable_state) { return 0; } @@ -407,4 +407,15 @@ static inline int extcon_unregister_interest(struct extcon_specific_cable_nb { return -EINVAL; } + +static inline int extcon_get_cable_state_(struct extcon_dev *edev, unsigned int id) +{ + return extcon_get_state(edev, id); +} + +static inline int extcon_set_cable_state_(struct extcon_dev *edev, unsigned int id, + bool cable_state) +{ + return extcon_set_state(edev, id, cable_state); +} #endif /* __LINUX_EXTCON_H__ */ -- 1.9.1