Re: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver

2018-02-21 Thread Andrew Lunn
> +static void lan743x_intr_unregister_isr(struct lan743x_adapter *adapter, > + int vector_index) > +{ > + struct lan743x_vector *vector = &adapter->intr.vector_list > + [vector_index]; > + > + devm_free_irq(&adapter->p

Re: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver

2018-02-22 Thread kbuild test robot
Hi Bryan, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on net-next/master] url: https://github.com/0day-ci/linux/commits/Bryan-Whitehead/lan743x-Add-new-lan743x-driver/20180222-225510 reproduce: # apt-get install sparse make ARCH=x86_64 allm

RE: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver

2018-02-22 Thread Bryan.Whitehead
> > +static void lan743x_intr_unregister_isr(struct lan743x_adapter *adapter, > > + int vector_index) > > +{ > > + struct lan743x_vector *vector = &adapter->intr.vector_list > > + [vector_index]; > > + > > + devm_free_irq(&adap

Re: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver

2018-02-22 Thread Florian Fainelli
On 02/22/2018 01:31 PM, bryan.whiteh...@microchip.com wrote: >>> +static void lan743x_intr_unregister_isr(struct lan743x_adapter *adapter, >>> + int vector_index) >>> +{ >>> + struct lan743x_vector *vector = &adapter->intr.vector_list >>> +

Re: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver

2018-02-22 Thread Andrew Lunn
> Also I'm allocating interrupt resources on interface up, and freeing resources > on interface down. So if there is an up, down, up sequence then the driver > will allocate resources twice. In order for devm to work properly, should I > move all resource allocation into the probe function? Hi Bry

Re: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver

2018-02-22 Thread Andrew Lunn
On Thu, Feb 22, 2018 at 10:45:34PM +0100, Andrew Lunn wrote: > > Also I'm allocating interrupt resources on interface up, and freeing > > resources > > on interface down. So if there is an up, down, up sequence then the driver > > will allocate resources twice. In order for devm to work properly,

Re: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver

2018-02-22 Thread Florian Fainelli
On 02/21/2018 11:06 AM, Bryan Whitehead wrote: > Add main source files for new lan743x driver. > > Signed-off-by: Bryan Whitehead > --- > +lan743x-objs := lan743x_main.o Should we assume that you have additional object files you would like to contribute at a later point? If that is the case, th

RE: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver

2018-02-22 Thread Bryan.Whitehead
> On Thu, Feb 22, 2018 at 10:45:34PM +0100, Andrew Lunn wrote: > > > Also I'm allocating interrupt resources on interface up, and freeing > > > resources on interface down. So if there is an up, down, up sequence > > > then the driver will allocate resources twice. In order for devm to > > > work p

RE: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver

2018-02-23 Thread Bryan.Whitehead
Hi Florian, Thanks for your review. I have the following questions/comments. > On 02/21/2018 11:06 AM, Bryan Whitehead wrote: > > Add main source files for new lan743x driver. > > > > Signed-off-by: Bryan Whitehead > > --- > > > +lan743x-objs := lan743x_main.o > > Should we assume that you have

Re: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver

2018-02-23 Thread Andrew Lunn
> Ok, but it seems to me that what I have is an example of "specific book > keeping > private information". Can you clarify the style you prefer? > > In cases of allocation where I can just compare a pointer to null, I can > easily remove > the flags. But in other cases I need a record of which

RE: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver

2018-02-25 Thread Bryan.Whitehead
> > Ok, but it seems to me that what I have is an example of "specific > > book keeping private information". Can you clarify the style you prefer? > > > > In cases of allocation where I can just compare a pointer to null, I > > can easily remove the flags. But in other cases I need a record of > >

Re: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver

2018-02-26 Thread Andrew Lunn
> But the other case is when things fail anywhere during probe, or > open. In these cases things are partially initialized and I assumed > I needed to clean up whatever was initialized successfully before > returning an error. I used flags so I could share a common clean up > function for all possi

RE: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver

2018-02-26 Thread Bryan.Whitehead
> Hi Bryan > > It is good to look at other drivers and see how they work. Ideally, your > driver > wants to look similar to all other drivers, so making the maintenance easier. > > You will find that most drivers have a set of goto statements for error > handling, which jump to the end of the fu