From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755927AbaDKKOM (ORCPT ); Fri, 11 Apr 2014 06:14:12 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:57225 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752544AbaDKKOK (ORCPT ); Fri, 11 Apr 2014 06:14:10 -0400 Message-ID: <5347CC75.8040300@ti.com> Date: Fri, 11 Apr 2014 14:05:25 +0300 From: Grygorii Strashko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Florian Fainelli CC: netdev , Randy Dunlap , Jonathan Cameron , "David S. Miller" , Prabhakar Lad , , Sekhar Nori , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , dlos Subject: Re: [PATCH 0/2] introduce devm_mdiobus_alloc/devm_mdiobus_free References: <1396618825-4241-1-git-send-email-grygorii.strashko@ti.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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