From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932253AbcHXMaW (ORCPT ); Wed, 24 Aug 2016 08:30:22 -0400 Received: from conssluserg-04.nifty.com ([210.131.2.83]:37257 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754304AbcHXMaS (ORCPT ); Wed, 24 Aug 2016 08:30:18 -0400 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com u7OCTK5w029661 X-Nifty-SrcIP: [209.85.213.176] MIME-Version: 1.0 In-Reply-To: <1472041622.5335.32.camel@pengutronix.de> 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> From: Masahiro Yamada Date: Wed, 24 Aug 2016 21:29:19 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] reset: uniphier: use of_device_get_match_data() to get matched data To: Philipp Zabel Cc: Linux Kernel Mailing List , linux-arm-kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Philipp, 2016-08-24 21:27 GMT+09:00 Philipp Zabel : > Hi Masahiro, > > Am Mittwoch, den 24.08.2016, 15:40 +0900 schrieb Masahiro Yamada: >> Use of_device_get_match_data() instead of of_match_node(). With >> this, we can retrieve the .data field of the OF match table more >> easily. No more need to define (or declare) the match table before >> the probe callback. I prefer to collect boilerplates at the bottom >> of the file, so moved it below. >> >> Signed-off-by: Masahiro Yamada >> --- >> >> drivers/reset/reset-uniphier.c | 81 +++++++++++++++++++++--------------------- >> 1 file changed, 40 insertions(+), 41 deletions(-) >> >> diff --git a/drivers/reset/reset-uniphier.c b/drivers/reset/reset-uniphier.c >> index 41c62af..9b3f2cd 100644 >> --- a/drivers/reset/reset-uniphier.c >> +++ b/drivers/reset/reset-uniphier.c >> @@ -16,6 +16,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -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! -- Best Regards Masahiro Yamada