Lines Matching refs:aggr

45 static int aggr_add_gpio(struct gpio_aggregator *aggr, const char *key,  in aggr_add_gpio()  argument
50 lookups = krealloc(aggr->lookups, struct_size(lookups, table, *n + 2), in aggr_add_gpio()
60 aggr->lookups = lookups; in aggr_add_gpio()
64 static int aggr_parse(struct gpio_aggregator *aggr) in aggr_parse() argument
66 char *args = skip_spaces(aggr->args); in aggr_parse()
83 error = aggr_add_gpio(aggr, name, U16_MAX, &n); in aggr_parse()
99 error = aggr_add_gpio(aggr, name, i, &n); in aggr_parse()
120 struct gpio_aggregator *aggr; in new_device_store() local
125 aggr = kzalloc(sizeof(*aggr) + count + 1, GFP_KERNEL); in new_device_store()
126 if (!aggr) in new_device_store()
129 memcpy(aggr->args, buf, count + 1); in new_device_store()
131 aggr->lookups = kzalloc(struct_size(aggr->lookups, table, 1), in new_device_store()
133 if (!aggr->lookups) { in new_device_store()
139 id = idr_alloc(&gpio_aggregator_idr, aggr, 0, 0, GFP_KERNEL); in new_device_store()
147 aggr->lookups->dev_id = kasprintf(GFP_KERNEL, "%s.%d", DRV_NAME, id); in new_device_store()
148 if (!aggr->lookups->dev_id) { in new_device_store()
153 res = aggr_parse(aggr); in new_device_store()
157 gpiod_add_lookup_table(aggr->lookups); in new_device_store()
165 aggr->pdev = pdev; in new_device_store()
169 gpiod_remove_lookup_table(aggr->lookups); in new_device_store()
171 kfree(aggr->lookups->dev_id); in new_device_store()
177 kfree(aggr->lookups); in new_device_store()
179 kfree(aggr); in new_device_store()
185 static void gpio_aggregator_free(struct gpio_aggregator *aggr) in gpio_aggregator_free() argument
187 platform_device_unregister(aggr->pdev); in gpio_aggregator_free()
188 gpiod_remove_lookup_table(aggr->lookups); in gpio_aggregator_free()
189 kfree(aggr->lookups->dev_id); in gpio_aggregator_free()
190 kfree(aggr->lookups); in gpio_aggregator_free()
191 kfree(aggr); in gpio_aggregator_free()
197 struct gpio_aggregator *aggr; in delete_device_store() local
209 aggr = idr_remove(&gpio_aggregator_idr, id); in delete_device_store()
211 if (!aggr) in delete_device_store()
214 gpio_aggregator_free(aggr); in delete_device_store()