1 The gpiommc configfs context structure needs locking, as configfs
2 does not lock access between files.
4 --- a/drivers/mmc/host/gpiommc.c
5 +++ b/drivers/mmc/host/gpiommc.c
7 struct platform_device *pdev;
8 /* The configuration */
9 struct gpiommc_platform_data pdata;
10 + /* Mutex to protect this structure */
14 #define GPIO_INVALID -1
19 + mutex_lock(&dev->mutex);
21 if (attr == &gpiommc_attr_DI) {
22 gpio = dev->pdata.pins.gpio_di;
23 if (gpio == GPIO_INVALID)
28 + mutex_unlock(&dev->mutex);
30 return err ? err : count;
37 + mutex_lock(&dev->mutex);
39 if (attr == &gpiommc_attr_register) {
40 err = strict_strtoul(page, 10, &data);
46 + mutex_unlock(&dev->mutex);
48 return err ? err : count;
55 + mutex_init(&dev->mutex);
56 config_item_init_type_name(&dev->item, name,
57 &gpiommc_dev_ci_type);