Re: [PATCH 0/2] introduce devm_mdiobus_alloc/devm_mdiobus_free

2014-04-11 Thread Grygorii Strashko
Hi Florian,
On 04/11/2014 07:55 AM, Florian Fainelli wrote:
> Hi Grygorii,
> 
> 2014-04-04 6:40 GMT-07:00 Grygorii Strashko :
>> Introduce a resource managed devm_mdiobus_alloc()/devm_mdiobus_free()
>> to automatically clean up MDIO bus alocations made by MDIO drivers,
>> thus leading to simplified MDIO drivers code.
>>
>> Update Davinci MDIO driver ss example of new devm APIs usage.
> 
> This does look good at first glance. net-next is currently closed at
> the moment, so this will have to be merged later.

Thanks. It can wait for 3.16, so I'll update & resend after rc1.
I have few more patches for davinci_mdio.c, so
my intention here was to check if I can base them on top of new API or not :)

> 
> At some point, we might also want to handle the mdio_bus irq array, as
> that one is also usually dynamically allocated. Maybe we could just do
> a static irq[PHY_MAX_ADDR] allocation, 32 times the size of an integer
> might not be worth a potential leak.

It sounds good, but first of all irq field of mii_bus structure has to be made 
private. 
And drivers have to use getter/setters to access it - then its type can be 
changes 
simply and safely.

By the way, mdiobus_register() can be handled using DEVM approach too, but it 
will a bit more complex.

[...]
> 

Regards,
- grygorii

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] introduce devm_mdiobus_alloc/devm_mdiobus_free

2014-04-11 Thread Grygorii Strashko
Hi Florian,
On 04/11/2014 07:55 AM, Florian Fainelli wrote:
 Hi Grygorii,
 
 2014-04-04 6:40 GMT-07:00 Grygorii Strashko grygorii.stras...@ti.com:
 Introduce a resource managed devm_mdiobus_alloc()/devm_mdiobus_free()
 to automatically clean up MDIO bus alocations made by MDIO drivers,
 thus leading to simplified MDIO drivers code.

 Update Davinci MDIO driver ss example of new devm APIs usage.
 
 This does look good at first glance. net-next is currently closed at
 the moment, so this will have to be merged later.

Thanks. It can wait for 3.16, so I'll update  resend after rc1.
I have few more patches for davinci_mdio.c, so
my intention here was to check if I can base them on top of new API or not :)

 
 At some point, we might also want to handle the mdio_bus irq array, as
 that one is also usually dynamically allocated. Maybe we could just do
 a static irq[PHY_MAX_ADDR] allocation, 32 times the size of an integer
 might not be worth a potential leak.

It sounds good, but first of all irq field of mii_bus structure has to be made 
private. 
And drivers have to use getter/setters to access it - then its type can be 
changes 
simply and safely.

By the way, mdiobus_register() can be handled using DEVM approach too, but it 
will a bit more complex.

[...]
 

Regards,
- grygorii

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] introduce devm_mdiobus_alloc/devm_mdiobus_free

2014-04-10 Thread Florian Fainelli
Hi Grygorii,

2014-04-04 6:40 GMT-07:00 Grygorii Strashko :
> Introduce a resource managed devm_mdiobus_alloc()/devm_mdiobus_free()
> to automatically clean up MDIO bus alocations made by MDIO drivers,
> thus leading to simplified MDIO drivers code.
>
> Update Davinci MDIO driver ss example of new devm APIs usage.

This does look good at first glance. net-next is currently closed at
the moment, so this will have to be merged later.

At some point, we might also want to handle the mdio_bus irq array, as
that one is also usually dynamically allocated. Maybe we could just do
a static irq[PHY_MAX_ADDR] allocation, 32 times the size of an integer
might not be worth a potential leak.

>
> Grygorii Strashko (2):
>   mdio_bus: implement devm_mdiobus_alloc/devm_mdiobus_free
>   net: davinci_mdio: use devm_* api
>
>  Documentation/driver-model/devres.txt  |4 ++
>  drivers/net/ethernet/ti/davinci_mdio.c |   21 ++
>  drivers/net/phy/mdio_bus.c |   68 
> 
>  include/linux/phy.h|2 +
>  4 files changed, 78 insertions(+), 17 deletions(-)
>
> --
> 1.7.9.5
>



-- 
Florian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] introduce devm_mdiobus_alloc/devm_mdiobus_free

2014-04-10 Thread Florian Fainelli
Hi Grygorii,

2014-04-04 6:40 GMT-07:00 Grygorii Strashko grygorii.stras...@ti.com:
 Introduce a resource managed devm_mdiobus_alloc()/devm_mdiobus_free()
 to automatically clean up MDIO bus alocations made by MDIO drivers,
 thus leading to simplified MDIO drivers code.

 Update Davinci MDIO driver ss example of new devm APIs usage.

This does look good at first glance. net-next is currently closed at
the moment, so this will have to be merged later.

At some point, we might also want to handle the mdio_bus irq array, as
that one is also usually dynamically allocated. Maybe we could just do
a static irq[PHY_MAX_ADDR] allocation, 32 times the size of an integer
might not be worth a potential leak.


 Grygorii Strashko (2):
   mdio_bus: implement devm_mdiobus_alloc/devm_mdiobus_free
   net: davinci_mdio: use devm_* api

  Documentation/driver-model/devres.txt  |4 ++
  drivers/net/ethernet/ti/davinci_mdio.c |   21 ++
  drivers/net/phy/mdio_bus.c |   68 
 
  include/linux/phy.h|2 +
  4 files changed, 78 insertions(+), 17 deletions(-)

 --
 1.7.9.5




-- 
Florian
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/2] introduce devm_mdiobus_alloc/devm_mdiobus_free

2014-04-04 Thread Grygorii Strashko
Introduce a resource managed devm_mdiobus_alloc()/devm_mdiobus_free()
to automatically clean up MDIO bus alocations made by MDIO drivers,
thus leading to simplified MDIO drivers code.

Update Davinci MDIO driver ss example of new devm APIs usage.

Grygorii Strashko (2):
  mdio_bus: implement devm_mdiobus_alloc/devm_mdiobus_free
  net: davinci_mdio: use devm_* api

 Documentation/driver-model/devres.txt  |4 ++
 drivers/net/ethernet/ti/davinci_mdio.c |   21 ++
 drivers/net/phy/mdio_bus.c |   68 
 include/linux/phy.h|2 +
 4 files changed, 78 insertions(+), 17 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/2] introduce devm_mdiobus_alloc/devm_mdiobus_free

2014-04-04 Thread Grygorii Strashko
Introduce a resource managed devm_mdiobus_alloc()/devm_mdiobus_free()
to automatically clean up MDIO bus alocations made by MDIO drivers,
thus leading to simplified MDIO drivers code.

Update Davinci MDIO driver ss example of new devm APIs usage.

Grygorii Strashko (2):
  mdio_bus: implement devm_mdiobus_alloc/devm_mdiobus_free
  net: davinci_mdio: use devm_* api

 Documentation/driver-model/devres.txt  |4 ++
 drivers/net/ethernet/ti/davinci_mdio.c |   21 ++
 drivers/net/phy/mdio_bus.c |   68 
 include/linux/phy.h|2 +
 4 files changed, 78 insertions(+), 17 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/