Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp638753ybz; Wed, 15 Apr 2020 15:42:05 -0700 (PDT) X-Google-Smtp-Source: APiQypJlhMAp8fJbYK4cF6E20T3Yl3EHMLGG817IRjkjVHypH15FVRpaegPTxQaL/7ut2q42sI/+ X-Received: by 2002:a17:906:4cd2:: with SMTP id q18mr7235357ejt.70.1586990524795; Wed, 15 Apr 2020 15:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586990524; cv=none; d=google.com; s=arc-20160816; b=PhGxV5bxxXP7nXG5l7b+CR9hEvvKbo1EytcFlHEB67YOik4d0uxFNboFc8AXG+jLsz EyFL6K202zqhY447jW/LLLLjPargEWxoH3opCU2e3nJoBug436b14r46yk1SrYlc9Vjl NKkhw/xJEaZmgsZE09vaQQHf8ZVSzUbJFjvxSv/b0Sw43JeemjyFjeO5zuCO3aCpYxwE LKRjw/fnuyS1p44CkhzUib19kT2+2a22b4GB1btdzWei2+pp+QtfMHapzDAu/XVBtZCE g+Q1+IeyZz0qVjvzo2f5bEh4VyC8sJlLSP49+AFJbC1mThj/iTDrtEiFv8gAHwlnPrJY Yr4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:reply-to:references:cc:to:from:subject :dkim-signature; bh=+/1Iu/JzHfTUUkNI63BRm5k6epAQ7MULGxto9H/1uEU=; b=WL62ugUUp2YHhWyWj6JOxLscQqJOEm4SvmpoR9zvfq+f44k2vvrlNwOqbHRQjb5pNp 3suU3VKx+ZmFcPpgcBPpC3QGkdhLqNHs/4RLyepWLndR3Ld4ws0f1ZXc9oEPBu5NaivE kwRMchtjxLtyk0H9uu/PHmF/kiKt7/LMNN3A2W9qz5y0ahgQkmugJCYHbTLaYByThljx P/tXO6I2P3gJRgegO04iz63JLUsrpdzgU7RZad2L+agALjHIdSkwhrxpD3zKTDhPCaJ7 CH7XAXtz++xVQQPwaBr9UhPcSFWEYg2/YM1+9R59hSJ/5S8xzXGGMD8KiYbevTsot25h Ub1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=mciyrlif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k17si3303812ejg.470.2020.04.15.15.41.41; Wed, 15 Apr 2020 15:42:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=mciyrlif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2895091AbgDOIuX (ORCPT + 99 others); Wed, 15 Apr 2020 04:50:23 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:39244 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2895079AbgDOIuS (ORCPT ); Wed, 15 Apr 2020 04:50:18 -0400 Received: from [192.168.0.20] (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 79A4E2D1; Wed, 15 Apr 2020 10:50:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1586940616; bh=gou09fnjFJvhR1x9fvB0QuYMTNpfnFWwyMLgGzqgFXc=; h=Subject:From:To:Cc:References:Reply-To:Date:In-Reply-To:From; b=mciyrlifwnsfZbPwmMECsp60Sa5GaH5OEbXqLC3v7CwL3kuwpWl5iLGhLhSPZPkGu 8LTMN31DTnFJSHR3aPAjRJRoRap9fhmjaYqBr7gszmO+WsJTZoeax/RW3rwll5hgPe 33v+ipaQY6FkcyNH4WXrrqE9fW3o5Iu2Mstd/LyM= Subject: Re: [RFC PATCH v2 4/6] i2c: of: error message unification From: Kieran Bingham To: Wolfram Sang , linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-i3c@lists.infradead.org, =?UTF-8?Q?Niklas_S=c3=b6derlund?= , Luca Ceresoli , Jacopo Mondi , Laurent Pinchart , Vladimir Zapolskiy , linux-kernel@vger.kernel.org, Geert Uytterhoeven References: <20200318150059.21714-1-wsa+renesas@sang-engineering.com> <20200318150059.21714-5-wsa+renesas@sang-engineering.com> <7014c94a-bb89-b282-52ee-49b42ab5aac1@bingham.xyz> Reply-To: kieran.bingham+renesas@ideasonboard.com Organization: Ideas on Board Message-ID: <4a63e7f5-8a0c-a9f1-640b-2f33c0076160@ideasonboard.com> Date: Wed, 15 Apr 2020 09:50:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <7014c94a-bb89-b282-52ee-49b42ab5aac1@bingham.xyz> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wolfram, On 15/04/2020 09:17, Kieran Bingham wrote: > Hi Wolfram, > > On 18/03/2020 15:00, Wolfram Sang wrote: >> - don't prefix the device if %pOF is provided. That information is >> enough. >> - move the prefix to pr_fmt >> - change prefix from "of_i2c" to "i2c_of" because the code was moved >> out of the of-domain long ago >> - drop error string for callers of of_i2c_register_device because it >> already reports enough (thanks to Tang Bin for the report!) >> >> Signed-off-by: Wolfram Sang >> Reviewed-by: Geert Uytterhoeven > > Reviewed-by: Kieran Bingham > >> --- >> drivers/i2c/i2c-core-of.c | 18 +++++++----------- >> 1 file changed, 7 insertions(+), 11 deletions(-) >> >> diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c >> index 710704cd583e..f2d09ea0d336 100644 >> --- a/drivers/i2c/i2c-core-of.c >> +++ b/drivers/i2c/i2c-core-of.c >> @@ -8,6 +8,8 @@ >> * Copyright (C) 2013, 2018 Wolfram Sang >> */ >> >> +#define pr_fmt(fmt) "i2c_of: " fmt >> + >> #include >> #include >> #include >> @@ -28,7 +30,7 @@ int of_i2c_get_board_info(struct device_node *node, struct i2c_board_info *info) Perhaps not directly needed by this patch but, at some point will you rename of_i2c_* to i2c_of_* ? >> >> ret = of_property_read_u32(node, "reg", &addr); >> if (ret) { >> - pr_err("of_i2c: invalid reg on %pOF\n", node); >> + pr_err("invalid reg on %pOF\n", node); >> return ret; >> } >> >> @@ -66,7 +68,7 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap, >> struct i2c_board_info info; >> int ret; >> >> - dev_dbg(&adap->dev, "of_i2c: register %pOF\n", node); >> + pr_debug("register %pOF\n", node); >> >> ret = of_i2c_get_board_info(node, &info); >> if (ret) >> @@ -74,7 +76,7 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap, >> >> client = i2c_new_client_device(adap, &info); >> if (IS_ERR(client)) >> - dev_err(&adap->dev, "of_i2c: Failure registering %pOF\n", node); >> + pr_err("failure registering %pOF (%ld)\n", node, PTR_ERR(client)); >> >> return client; >> } >> @@ -88,7 +90,7 @@ void of_i2c_register_devices(struct i2c_adapter *adap) >> if (!adap->dev.of_node) >> return; >> >> - dev_dbg(&adap->dev, "of_i2c: walking child nodes\n"); >> + dev_dbg(&adap->dev, "walking child nodes\n"); >> >> bus = of_get_child_by_name(adap->dev.of_node, "i2c-bus"); >> if (!bus) >> @@ -99,12 +101,8 @@ void of_i2c_register_devices(struct i2c_adapter *adap) >> continue; >> >> client = of_i2c_register_device(adap, node); >> - if (IS_ERR(client)) { >> - dev_err(&adap->dev, >> - "Failed to create I2C device for %pOF\n", >> - node); >> + if (IS_ERR(client)) >> of_node_clear_flag(node, OF_POPULATED); >> - } >> } >> >> of_node_put(bus); >> @@ -243,8 +241,6 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action, >> >> client = of_i2c_register_device(adap, rd->dn); >> if (IS_ERR(client)) { >> - dev_err(&adap->dev, "failed to create client for '%pOF'\n", >> - rd->dn); >> put_device(&adap->dev); >> of_node_clear_flag(rd->dn, OF_POPULATED); >> return notifier_from_errno(PTR_ERR(client)); >> >