提交 0a135b88 编写于 作者: B Benjamin Tissoires 提交者: Dmitry Torokhov

Input: synaptics-rmi4 - have only one struct platform data

If struct rmi_device_platform_data contains pointers to other struct,
it gets difficult to allocate a fixed size struct and copy it over between
drivers.

Change the pointers into a struct and change the code in rmi4 accordingly.
Reviewed-by: NAndrew Duggan <aduggan@synaptics.com>
Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 e9dade41
...@@ -1080,8 +1080,8 @@ static int rmi_f11_initialize(struct rmi_function *fn) ...@@ -1080,8 +1080,8 @@ static int rmi_f11_initialize(struct rmi_function *fn)
rc = rmi_2d_sensor_of_probe(&fn->dev, &f11->sensor_pdata); rc = rmi_2d_sensor_of_probe(&fn->dev, &f11->sensor_pdata);
if (rc) if (rc)
return rc; return rc;
} else if (pdata->sensor_pdata) { } else {
f11->sensor_pdata = *pdata->sensor_pdata; f11->sensor_pdata = pdata->sensor_pdata;
} }
f11->rezero_wait_ms = f11->sensor_pdata.rezero_wait; f11->rezero_wait_ms = f11->sensor_pdata.rezero_wait;
......
...@@ -352,8 +352,8 @@ static int rmi_f12_probe(struct rmi_function *fn) ...@@ -352,8 +352,8 @@ static int rmi_f12_probe(struct rmi_function *fn)
ret = rmi_2d_sensor_of_probe(&fn->dev, &f12->sensor_pdata); ret = rmi_2d_sensor_of_probe(&fn->dev, &f12->sensor_pdata);
if (ret) if (ret)
return ret; return ret;
} else if (pdata->sensor_pdata) { } else {
f12->sensor_pdata = *pdata->sensor_pdata; f12->sensor_pdata = pdata->sensor_pdata;
} }
ret = rmi_read_register_desc(rmi_dev, query_addr, ret = rmi_read_register_desc(rmi_dev, query_addr,
......
...@@ -196,7 +196,7 @@ static int rmi_f30_config(struct rmi_function *fn) ...@@ -196,7 +196,7 @@ static int rmi_f30_config(struct rmi_function *fn)
rmi_get_platform_data(fn->rmi_dev); rmi_get_platform_data(fn->rmi_dev);
int error; int error;
if (pdata->f30_data && pdata->f30_data->disable) { if (pdata->f30_data.disable) {
drv->clear_irq_bits(fn->rmi_dev, fn->irq_mask); drv->clear_irq_bits(fn->rmi_dev, fn->irq_mask);
} else { } else {
/* Write Control Register values back to device */ /* Write Control Register values back to device */
...@@ -355,7 +355,7 @@ static inline int rmi_f30_initialize(struct rmi_function *fn) ...@@ -355,7 +355,7 @@ static inline int rmi_f30_initialize(struct rmi_function *fn)
f30->gpioled_key_map = (u16 *)map_memory; f30->gpioled_key_map = (u16 *)map_memory;
pdata = rmi_get_platform_data(rmi_dev); pdata = rmi_get_platform_data(rmi_dev);
if (pdata && f30->has_gpio) { if (f30->has_gpio) {
button = BTN_LEFT; button = BTN_LEFT;
for (i = 0; i < f30->gpioled_count; i++) { for (i = 0; i < f30->gpioled_count; i++) {
if (rmi_f30_is_valid_button(i, f30->ctrl)) { if (rmi_f30_is_valid_button(i, f30->ctrl)) {
...@@ -366,8 +366,7 @@ static inline int rmi_f30_initialize(struct rmi_function *fn) ...@@ -366,8 +366,7 @@ static inline int rmi_f30_initialize(struct rmi_function *fn)
* f30->has_mech_mouse_btns, but I am * f30->has_mech_mouse_btns, but I am
* not sure, so use only the pdata info * not sure, so use only the pdata info
*/ */
if (pdata->f30_data && if (pdata->f30_data.buttonpad)
pdata->f30_data->buttonpad)
break; break;
} }
} }
...@@ -382,7 +381,7 @@ static int rmi_f30_probe(struct rmi_function *fn) ...@@ -382,7 +381,7 @@ static int rmi_f30_probe(struct rmi_function *fn)
const struct rmi_device_platform_data *pdata = const struct rmi_device_platform_data *pdata =
rmi_get_platform_data(fn->rmi_dev); rmi_get_platform_data(fn->rmi_dev);
if (pdata->f30_data && pdata->f30_data->disable) if (pdata->f30_data.disable)
return 0; return 0;
rc = rmi_f30_initialize(fn); rc = rmi_f30_initialize(fn);
......
...@@ -218,9 +218,9 @@ struct rmi_device_platform_data { ...@@ -218,9 +218,9 @@ struct rmi_device_platform_data {
struct rmi_device_platform_data_spi spi_data; struct rmi_device_platform_data_spi spi_data;
/* function handler pdata */ /* function handler pdata */
struct rmi_2d_sensor_platform_data *sensor_pdata; struct rmi_2d_sensor_platform_data sensor_pdata;
struct rmi_f01_power_management power_management; struct rmi_f01_power_management power_management;
struct rmi_f30_data *f30_data; struct rmi_f30_data f30_data;
}; };
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册