Re: [RFC] [PATCH] Input: ADP5588 - Support gpio function on unused pin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



One more thing...

On Fri, Jul 16, 2010 at 09:20:18AM -0700, Dmitry Torokhov wrote:
> On Fri, Jul 16, 2010 at 07:48:07PM +0800, Xiaolong CHEN wrote:
> >  static int __devexit adp5588_remove(struct i2c_client *client)
> >  {
> > +	int ret;
> >  	struct adp5588_kpad *kpad = i2c_get_clientdata(client);
> > 
> >  	adp5588_write(client, CFG, 0);
> >  	free_irq(client->irq, kpad);
> >  	cancel_delayed_work_sync(&kpad->work);
> >  	input_unregister_device(kpad->input);
> > +	if (kpad->support_gpio)
> > +		ret = gpiochip_remove(&kpad->gpio_chip);

You need to actually handle this (add an error message) since we can't
simply ignore errors.

However I think that having gpiochip_remove() __must_check while
gpiochip_add is quite silly.

I'd argue that gpiochip_remove() should wither WARN or BUG if we trying
to remove a chip that still has GPIOs requested and return void since
callers normally can't do anything about the failure. Many simply abort
device teardown leaving device a zombie and report failure up the stack,
to the driver core, where it is ignored. Not very helpful.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux