Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp912242ybv; Thu, 20 Feb 2020 09:26:41 -0800 (PST) X-Google-Smtp-Source: APXvYqyuprXOtuwN9pLpTfbd2ovH0+aNhR0RN+umY2rTZg1Ne3R7zbKgVcMrplOYTZTIfzVhw5da X-Received: by 2002:a05:6830:1296:: with SMTP id z22mr23663971otp.354.1582219601730; Thu, 20 Feb 2020 09:26:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582219601; cv=none; d=google.com; s=arc-20160816; b=dZQWJpZIyD91hv24OXwy6pcYCAWiDKnpLKmrG19Nu9RV9PPSwwVZjWDPduNxon/onb /A646SAb992CT2Uz8DV6Eh8s38qHiWHDoprWwvXQSRgJyICwZfEC1WfwWc5ARPOH0NB3 Kl5fae1CInIis3Ds4xtb5XSTPONajiiWqp9DJOUUKpcozC6am8szvgT7kyUN1qOn2bDG eYbOtBzZj00sv5ka/arnhB6vCFsTrCf/nhUWAa45OyxryNlZhcs0SqJuAb6OtOmJs+t0 I0yL1NeDkSldEdi7/dySnpus2lrH6BScD14azTyzq9uxqYsfaE0L6BDxIPU4XemEZPDc qAXA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=wBkCmtc5xXt4AaslEpa0dEnVk29xDbbr44G0FhhebAc=; b=dY62Lc1iejSsdOr3427/P8VXdJmffa4K70ytupQMB6mDNeCbHBpb6RXwWDKv6GU9u7 R4ra1r15il+alCvfSRDDoCVfL7ITlrOPBUbSHrgvLk5yxSIyVh7XU7372eWCyaoitOOU Nsv9OqpD0aiBPJ1/1AqvzbDfAa3MI4b3TiEsUrHm6gUPimI57zcgIhHOGMZmIQnDi6q5 GvfvP6OG339CLDMLvO/Im7R6PJUrZA1WYwDj0X7b7frzg0cxK2Te9x+eljspGkNebfBt cb0MVyIwZdeIEdi6Lf3YOi44acrwo72Xx+GJPEFPqOXJaWUyKKW0ieMZyQ+e++h/tMGm PUOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si2974otn.140.2020.02.20.09.26.29; Thu, 20 Feb 2020 09:26:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728955AbgBTR0L (ORCPT + 99 others); Thu, 20 Feb 2020 12:26:11 -0500 Received: from sauhun.de ([88.99.104.3]:35158 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728856AbgBTRZ4 (ORCPT ); Thu, 20 Feb 2020 12:25:56 -0500 Received: from localhost (p5486CC48.dip0.t-ipconnect.de [84.134.204.72]) by pokefinder.org (Postfix) with ESMTPSA id 4E2892C1EC1; Thu, 20 Feb 2020 18:25:53 +0100 (CET) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-i3c@lists.infradead.org, Kieran Bingham , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Luca Ceresoli , Jacopo Mondi , Laurent Pinchart , Vladimir Zapolskiy , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Wolfram Sang Subject: [RFC PATCH 5/7] i2c: of: error message unification Date: Thu, 20 Feb 2020 18:24:01 +0100 Message-Id: <20200220172403.26062-6-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200220172403.26062-1-wsa+renesas@sang-engineering.com> References: <20200220172403.26062-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org - 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 Signed-off-by: Wolfram Sang --- drivers/i2c/i2c-core-of.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c index 710704cd583e..74b9f3fbb5ef 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) 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\n", node); 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) @@ -100,9 +102,7 @@ void of_i2c_register_devices(struct i2c_adapter *adap) client = of_i2c_register_device(adap, node); if (IS_ERR(client)) { - dev_err(&adap->dev, - "Failed to create I2C device for %pOF\n", - node); + pr_err("failed to create I2C device for %pOF\n", node); of_node_clear_flag(node, OF_POPULATED); } } @@ -243,8 +243,7 @@ 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); + pr_err("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)); -- 2.20.1