Re: [PATCH 4/8] staging: et131x: Add pci suspend & resume functions

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

 



Mark Einon <mark.einon@xxxxxxxxx> :
> On 1 October 2011 12:03, Francois Romieu <romieu@xxxxxxxxxxxxx> wrote:
[...]
> >> + ? ? err = et131x_open(netdev);
> >> + ? ? if (err) {
> >> + ? ? ? ? ? ? dev_err(&pdev->dev, "Can't resume interface!\n");
> >> + ? ? ? ? ? ? goto out;
> >> + ? ? }
> >
> > You can/should split et131x_{open/close} to remove this failure point.
> 
> Hi, thanks for the comments francois,
> I'm not quite sure what you mean here. Can you expand on your comment please?

Something like:

int et131x_open(struct net_device *netdev)
{
	add_timer(...)

	err = request_irq(...)
	if (err < 0)
		goto release_timer;

	et131x_start(...)

out:
	return err;

release_timer:
	blah;
	goto out;
}

Same thing with et131x_close / et131x_stop. You only use et131x_{start/stop}
for suspend/resume : one error path is gone away.

-- 
Ueimor
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux