Commit 2519b765 authored by Chanwoo Choi's avatar Chanwoo Choi

extcon: Remove optional print_state() function pointer of struct extcon_dev

This patch removes the optional print_state() function pointer which included
in 'struct extcon_dev' because the extcon must maintain the consistent name
of extcon device on sysfs instead of inconsistent state of external connectors.
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent 85a77ff0
...@@ -65,22 +65,6 @@ static irqreturn_t gpio_irq_handler(int irq, void *dev_id) ...@@ -65,22 +65,6 @@ static irqreturn_t gpio_irq_handler(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static ssize_t extcon_gpio_print_state(struct extcon_dev *edev, char *buf)
{
struct device *dev = edev->dev.parent;
struct gpio_extcon_data *extcon_data = dev_get_drvdata(dev);
const char *state;
if (extcon_get_state(edev))
state = extcon_data->state_on;
else
state = extcon_data->state_off;
if (state)
return sprintf(buf, "%s\n", state);
return -EINVAL;
}
static int gpio_extcon_probe(struct platform_device *pdev) static int gpio_extcon_probe(struct platform_device *pdev)
{ {
struct gpio_extcon_platform_data *pdata = dev_get_platdata(&pdev->dev); struct gpio_extcon_platform_data *pdata = dev_get_platdata(&pdev->dev);
...@@ -110,8 +94,6 @@ static int gpio_extcon_probe(struct platform_device *pdev) ...@@ -110,8 +94,6 @@ static int gpio_extcon_probe(struct platform_device *pdev)
extcon_data->state_on = pdata->state_on; extcon_data->state_on = pdata->state_on;
extcon_data->state_off = pdata->state_off; extcon_data->state_off = pdata->state_off;
extcon_data->check_on_resume = pdata->check_on_resume; extcon_data->check_on_resume = pdata->check_on_resume;
if (pdata->state_on && pdata->state_off)
extcon_data->edev->print_state = extcon_gpio_print_state;
ret = devm_gpio_request_one(&pdev->dev, extcon_data->gpio, GPIOF_DIR_IN, ret = devm_gpio_request_one(&pdev->dev, extcon_data->gpio, GPIOF_DIR_IN,
pdev->name); pdev->name);
......
...@@ -172,14 +172,6 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr, ...@@ -172,14 +172,6 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr,
int i, count = 0; int i, count = 0;
struct extcon_dev *edev = dev_get_drvdata(dev); struct extcon_dev *edev = dev_get_drvdata(dev);
if (edev->print_state) {
int ret = edev->print_state(edev, buf);
if (ret >= 0)
return ret;
/* Use default if failed */
}
if (edev->max_supported == 0) if (edev->max_supported == 0)
return sprintf(buf, "%u\n", edev->state); return sprintf(buf, "%u\n", edev->state);
......
...@@ -75,8 +75,6 @@ struct extcon_cable; ...@@ -75,8 +75,6 @@ struct extcon_cable;
* be attached simulataneously. {0x7, 0} is equivalent to * be attached simulataneously. {0x7, 0} is equivalent to
* {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there
* can be no simultaneous connections. * can be no simultaneous connections.
* @print_state: An optional callback to override the method to print the
* status of the extcon device.
* @dev: Device of this extcon. * @dev: Device of this extcon.
* @state: Attach/detach state of this extcon. Do not provide at * @state: Attach/detach state of this extcon. Do not provide at
* register-time. * register-time.
...@@ -100,9 +98,6 @@ struct extcon_dev { ...@@ -100,9 +98,6 @@ struct extcon_dev {
const unsigned int *supported_cable; const unsigned int *supported_cable;
const u32 *mutually_exclusive; const u32 *mutually_exclusive;
/* Optional callbacks to override class functions */
ssize_t (*print_state)(struct extcon_dev *edev, char *buf);
/* Internal data. Please do not set. */ /* Internal data. Please do not set. */
struct device dev; struct device dev;
struct raw_notifier_head *nh; struct raw_notifier_head *nh;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment