From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756007AbcHXNcn (ORCPT ); Wed, 24 Aug 2016 09:32:43 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:54643 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753012AbcHXNcl (ORCPT ); Wed, 24 Aug 2016 09:32:41 -0400 Message-ID: <1472045527.5335.46.camel@pengutronix.de> Subject: Re: [PATCH 2/2] reset: uniphier: use of_device_get_match_data() to get matched data From: Philipp Zabel To: Masahiro Yamada Cc: Linux Kernel Mailing List , linux-arm-kernel Date: Wed, 24 Aug 2016 15:32:07 +0200 In-Reply-To: References: <1472020830-16059-1-git-send-email-yamada.masahiro@socionext.com> <1472020830-16059-3-git-send-email-yamada.masahiro@socionext.com> <1472041622.5335.32.camel@pengutronix.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:96de:80ff:fec2:9969 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, den 24.08.2016, 21:29 +0900 schrieb Masahiro Yamada: [...] > >> @@ -285,6 +286,45 @@ static const struct reset_control_ops uniphier_reset_ops = { > >> .status = uniphier_reset_status, > >> }; > >> > >> +static int uniphier_reset_probe(struct platform_device *pdev) > >> +{ > >> + struct device *dev = &pdev->dev; > >> + struct uniphier_reset_priv *priv; > >> + const struct uniphier_reset_data *p, *data; > >> + struct regmap *regmap; > >> + struct device_node *parent; > >> + unsigned int nr_resets = 0; > >> + > >> + data = of_device_get_match_data(dev); > >> + WARN_ON(!data); > > > > I know right now this can't happen anyway, but you did return -EINVAL > > here before. Maybe use: > > > > if (WARN_ON(!data)) > > return -EINVAL; > > > > instead? I can fix it up if you agree. > > I agree. > > Please fix it up. Thanks! Ok, done. regards Philipp