[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <1469099373-30194-5-git-send-email-cw00.choi@samsung.com>
Date: Thu, 21 Jul 2016 20:09:32 +0900
From: Chanwoo Choi <cw00.choi@...sung.com>
To: linux-kernel@...r.kernel.org
Cc: cw00.choi@...sung.com, myungjoo.ham@...sung.com,
ckeepax@...nsource.wolfsonmicro.com
Subject: [PATCH v2 4/5] extcon: Remove the state_store() to prevent the wrong
access
This patch removes the state_store() which change the state of external
connectors with bit masking on user-space. It is wrong access to modify
the change the state of external connectors.
Signed-off-by: Chanwoo Choi <cw00.choi@...sung.com>
---
drivers/extcon/extcon.c | 21 +--------------------
1 file changed, 1 insertion(+), 20 deletions(-)
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index 319659c6af28..ad5e4546f82c 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -174,26 +174,7 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr,
return count;
}
-
-static ssize_t state_store(struct device *dev, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- u32 state;
- ssize_t ret = 0;
- struct extcon_dev *edev = dev_get_drvdata(dev);
-
- ret = sscanf(buf, "0x%x", &state);
- if (ret == 0)
- ret = -EINVAL;
- else
- ret = extcon_set_state(edev, state);
-
- if (ret < 0)
- return ret;
-
- return count;
-}
-static DEVICE_ATTR_RW(state);
+static DEVICE_ATTR_RO(state);
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
char *buf)
--
1.9.1
Powered by blists - more mailing lists