[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130226012317.GF2679@htj.dyndns.org>
Date: Mon, 25 Feb 2013 17:23:17 -0800
From: 'Tejun Heo' <tj@...nel.org>
To: Jingoo Han <jg1.han@...sung.com>
Cc: 'Andrew Morton' <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, 'Greg KH' <greg@...ah.com>,
'Alessandro Zummo' <a.zummo@...ertech.it>,
rtc-linux@...glegroups.com
Subject: Re: [PATCH V2] rtc: add devm_rtc_device_{register,unregister}()
Hello,
On Tue, Feb 26, 2013 at 10:21:06AM +0900, Jingoo Han wrote:
> These functios allows the driver core to automatically clean up
> any allocation made by rtc drivers. Thus, it simplifies the error
> paths.
>
> Signed-off-by: Jingoo Han <jg1.han@...sung.com>
Looks okay to me but
> +static int devm_rtc_device_match(struct device *dev, void *res, void *data)
> +{
> + struct rtc **r = res;
> + if (WARN_ON(!r || !*r))
> + return 0;
> +
> + return *r == data;
> +}
again, why do we need the WARN_ON() at all given that other
devm_*_match() don't do that and the only way to get NULL there would
be bug in devm_rtc*() code itself rather than its users?
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists