Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1431967 > unrolled thread
| Started by | Chanwoo Choi <cw00.choi@samsung.com> |
|---|---|
| First post | 2016-06-27 13:40 +0200 |
| Last post | 2016-06-27 13:40 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/3] extcon: Refactoring the core and add resource-managed functions for notifier Chanwoo Choi <cw00.choi@samsung.com> - 2016-06-27 13:40 +0200
[PATCH 1/3] extcon: Move struct extcon_cable from header file to core Chanwoo Choi <cw00.choi@samsung.com> - 2016-06-27 13:40 +0200
| From | Chanwoo Choi <cw00.choi@samsung.com> |
|---|---|
| Date | 2016-06-27 13:40 +0200 |
| Subject | [PATCH 0/3] extcon: Refactoring the core and add resource-managed functions for notifier |
| Message-ID | <rOD3s-83w-17@gated-at.bofh.it> |
This patch-set are refactoring the extcon core without the modification of operation. The struct extcon_cabe moves from header file to extcon core and make the new devres.c driver which only handles the resource-managed functions. Lastly, this patch-set add resource-managed functions for extcon register to handle it automatically when probe fail occur or device is removed. Chanwoo Choi (3): extcon: Move struct extcon_cable from header file to core extcon: Split out the resource-managed functions from extcon core extcon: Add resource-managed functions to register extcon notifier drivers/extcon/Makefile | 2 +- drivers/extcon/devres.c | 216 ++++++++++++++++++++++++++++++++++++++++++++++++ drivers/extcon/extcon.c | 137 +++++------------------------- include/linux/extcon.h | 37 ++++----- 4 files changed, 254 insertions(+), 138 deletions(-) create mode 100644 drivers/extcon/devres.c -- 1.9.1
[toc] | [next] | [standalone]
| From | Chanwoo Choi <cw00.choi@samsung.com> |
|---|---|
| Date | 2016-06-27 13:40 +0200 |
| Subject | [PATCH 1/3] extcon: Move struct extcon_cable from header file to core |
| Message-ID | <rOD3t-83w-37@gated-at.bofh.it> |
| In reply to | #1431967 |
This patch moves the struct extcon_cable because that should
be only handled by extcon core. There are no reason to publish
the internal structure.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
drivers/extcon/extcon.c | 20 ++++++++++++++++++++
include/linux/extcon.h | 20 --------------------
2 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index b6408f015637..b5fdb5d9dbad 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -77,6 +77,26 @@ static const char *extcon_name[] = {
NULL,
};
+/**
+ * struct extcon_cable - An internal data for each cable of extcon device.
+ * @edev: The extcon device
+ * @cable_index: Index of this cable in the edev
+ * @attr_g: Attribute group for the cable
+ * @attr_name: "name" sysfs entry
+ * @attr_state: "state" sysfs entry
+ * @attrs: Array pointing to attr_name and attr_state for attr_g
+ */
+struct extcon_cable {
+ struct extcon_dev *edev;
+ int cable_index;
+
+ struct attribute_group attr_g;
+ struct device_attribute attr_name;
+ struct device_attribute attr_state;
+
+ struct attribute *attrs[3]; /* to be fed to attr_g.attrs */
+};
+
static struct class *extcon_class;
#if defined(CONFIG_ANDROID)
static struct class_compat *switch_class;
diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index cec5c543afc6..1b2c8b6809cc 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -126,26 +126,6 @@ struct extcon_dev {
struct device_attribute *d_attrs_muex;
};
-/**
- * struct extcon_cable - An internal data for each cable of extcon device.
- * @edev: The extcon device
- * @cable_index: Index of this cable in the edev
- * @attr_g: Attribute group for the cable
- * @attr_name: "name" sysfs entry
- * @attr_state: "state" sysfs entry
- * @attrs: Array pointing to attr_name and attr_state for attr_g
- */
-struct extcon_cable {
- struct extcon_dev *edev;
- int cable_index;
-
- struct attribute_group attr_g;
- struct device_attribute attr_name;
- struct device_attribute attr_state;
-
- struct attribute *attrs[3]; /* to be fed to attr_g.attrs */
-};
-
#if IS_ENABLED(CONFIG_EXTCON)
/*
--
1.9.1
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web