[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140425151222.GE29632@saruman.home>
Date: Fri, 25 Apr 2014 10:12:22 -0500
From: Felipe Balbi <balbi@...com>
To: Chanwoo Choi <cw00.choi@...sung.com>
CC: <linux-kernel@...r.kernel.org>, <myungjoo.ham@...sung.com>,
<balbi@...com>, <gg@...mlogic.co.uk>, <kishon@...com>,
<ckeepax@...nsource.wolfsonmicro.com>, <broonie@...nel.org>,
<k.kozlowski@...sung.com>, <kyungmin.park@...sung.com>
Subject: Re: [PATCHv4 1/9] extcon: Add extcon_dev_allocate/free() to control
the memory of extcon device
On Fri, Apr 25, 2014 at 09:42:16AM +0900, Chanwoo Choi wrote:
> This patch add APIs to control the extcon device on extcon provider driver.
> The extcon_dev_allocate() allocates the memory of extcon device and initializes
> supported cables. And then extcon_dev_free() decrement the reference of the
> device of extcon device and free the memory of the extcon device. This APIs
> must need to implement devm_extcon_dev_allocate()/free() APIs.
>
> Signed-off-by: Chanwoo Choi <cw00.choi@...sung.com>
except for the one comment below, you can add:
Reviewed-by: Felipe Balbi <balbi@...com>
> @@ -267,6 +273,13 @@ static inline int devm_extcon_dev_register(struct device *dev,
> static inline void devm_extcon_dev_unregister(struct device *dev,
> struct extcon_dev *edev) { }
>
> +static inline struct extcon_dev *extcon_dev_allocate(const char **cables)
> +{
> + return ERR_PTR(-ENOMEM);
so this is executed when extcon isn't enabled right ? -ENOMEM is kind of
lying to your user. You're telling the user that you don't have memory
when in reality you didn't implement this function. -ENOSYS looks like a
better choice
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists