Re: [PATCH v2 1/3] Input: ad7897 - use managed allocated resources

2017-11-08 Thread Andi Shyti
> > - ts = kzalloc(sizeof(struct ad7877), GFP_KERNEL); > > - input_dev = input_allocate_device(); > > - if (!ts || !input_dev) { > > - err = -ENOMEM; > > - goto err_free_mem; > > - } > > + ts = devm_kzalloc(&spi->dev, sizeof(struct ad7877), GFP_KERNEL); > > + input_d

Re: [PATCH v2 1/3] Input: ad7897 - use managed allocated resources

2017-11-08 Thread Lars-Peter Clausen
On 11/08/2017 03:04 PM, Andi Shyti wrote: > Use managed allocated resources to simplify error handling during > probing failure and module exiting. > > With this all the goto labels in the probe function together with > the cleanups in the remove function are unnecessary, therefore > removed. > >

[PATCH v2 1/3] Input: ad7897 - use managed allocated resources

2017-11-08 Thread Andi Shyti
Use managed allocated resources to simplify error handling during probing failure and module exiting. With this all the goto labels in the probe function together with the cleanups in the remove function are unnecessary, therefore removed. CC: Michael Hennerich Signed-off-by: Andi Shyti --- dr