Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932751AbbD0MOm (ORCPT ); Mon, 27 Apr 2015 08:14:42 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:64631 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932466AbbD0MNn (ORCPT ); Mon, 27 Apr 2015 08:13:43 -0400 X-AuditID: cbfee690-f796f6d000005054-a2-553e27f30013 From: Chanwoo Choi To: linux-kernel@vger.kernel.org Cc: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, ckeepax@opensource.wolfsonmicro.com, cw00.choi@samsung.com Subject: [PATCH 2/4] extcon: Add extcon_get_edev_name() API to get the extcon device name Date: Mon, 27 Apr 2015 21:13:36 +0900 Message-id: <1430136818-11657-3-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.5.5 In-reply-to: <1430136818-11657-1-git-send-email-cw00.choi@samsung.com> References: <1430136818-11657-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGLMWRmVeSWpSXmKPExsWyRsSkUPezul2owYGTahb/ptxgt7j+5Tmr xdmmN+wWl3fNYbO43biCzYHV4+XE32wefVtWMXp83iQXwBzFZZOSmpNZllqkb5fAldH/ajtz QS9vxbo1PcwNjC3cXYycHBICJhKf991igrDFJC7cW8/WxcjFISSwlFFibkcDO0zRz/XL2UBs IYHpjBIvtxpDFH1hlGhf3MMKkmAT0JLY/+IGWJGIgILE5t5nYHFmgVKJzX1PweLCAtES18/d BdrGwcEioCrxbDYjSJhXwFWia/p8NohdChLLls8Ea+UUcJN4t/YYI8ReV4neI7uYQfZKCHxn k5g74whYEYuAgMS3yYdYQGZKCMhKbDrADDFHUuLgihssExiFFzAyrGIUTS1ILihOSi8y0StO zC0uzUvXS87P3cQIDN7T/55N2MF474D1IUYBDkYlHl6JibahQqyJZcWVuYcYTYE2TGSWEk3O B8ZIXkm8obGZkYWpiamxkbmlmZI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kg01GIuKk4EAKY1x4GjAgAA 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 Content-Length: 1874 Lines: 53 This patch adds the extcon_get_edev_name() API to get the name of extcon device because all information inclued in the structure extcon_dev should be accessed by extcon core API instead of directly accessing the data. Signed-off-by: Chanwoo Choi --- drivers/extcon/extcon.c | 9 +++++++++ include/linux/extcon.h | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index 1a93229..c5e9ebf 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -1046,6 +1046,15 @@ struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index) #endif /* CONFIG_OF */ EXPORT_SYMBOL_GPL(extcon_get_edev_by_phandle); +/** + * extcon_get_edev_name() - Get the name of the extcon device. + * @edev: the extcon device + */ +const char *extcon_get_edev_name(struct extcon_dev *edev) +{ + return !edev ? NULL : edev->name; +} + static int __init extcon_class_init(void) { return create_extcon_class(); diff --git a/include/linux/extcon.h b/include/linux/extcon.h index 36f49c4..e2cf625 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h @@ -259,6 +259,10 @@ extern int extcon_unregister_notifier(struct extcon_dev *edev, * 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); + +/* Following API to get information of extcon device */ +extern const char *extcon_get_edev_name(struct extcon_dev *edev); + #else /* CONFIG_EXTCON */ static inline int extcon_dev_register(struct extcon_dev *edev) { -- 1.8.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/