From patchwork Fri Jun 10 10:45:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 581053 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8791FC43334 for ; Fri, 10 Jun 2022 10:49:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349203AbiFJKt4 (ORCPT ); Fri, 10 Jun 2022 06:49:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349256AbiFJKto (ORCPT ); Fri, 10 Jun 2022 06:49:44 -0400 Received: from mail.baikalelectronics.com (mail.baikalelectronics.com [87.245.175.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F158D1C5D51; Fri, 10 Jun 2022 03:45:08 -0700 (PDT) Received: from mail (mail.baikal.int [192.168.51.25]) by mail.baikalelectronics.com (Postfix) with ESMTP id B6D4816A0; Fri, 10 Jun 2022 13:45:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.baikalelectronics.com B6D4816A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baikalelectronics.ru; s=mail; t=1654857959; bh=tUsMkKrbBOHaIAqKJuehJvo9RUUKed+0bAh6qd+CJ/c=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=ZMVGUhEii4yQAv9fgZsw01VZEWG8oMEZkXhgLxLh4OIr7fmfAYdp2QcAumBqbH9wz uGznREIDYzWFkVoWdq5f9qF9X3kjjmkloBsQprJUNYcYKUiNcEK25iIZP9aN9ldr/G VYGl6rqUrxW0HuzDXX7VIJJZKE/g+nA8pEuYnItI= Received: from localhost (192.168.53.207) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 10 Jun 2022 13:45:06 +0300 From: Serge Semin To: Hoan Tran , Serge Semin , Linus Walleij , Bartosz Golaszewski CC: Serge Semin , Alexey Malahov , Pavel Parkhomenko , Andy Shevchenko , Andy Shevchenko , Philipp Zabel , , Subject: [PATCH v2] gpio: dwapb: Don't print error on -EPROBE_DEFER Date: Fri, 10 Jun 2022 13:45:00 +0300 Message-ID: <20220610104500.28774-1-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20220610075152.10214-1-Sergey.Semin@baikalelectronics.ru> References: <20220610075152.10214-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Currently if the APB or Debounce clocks aren't yet ready to be requested the DW GPIO driver will correctly handle that by deferring the probe procedure, but the error is still printed to the system log. It needlessly pollutes the log since there was no real error but a request to postpone the clock request procedure since the clocks subsystem hasn't been fully initialized yet. Let's fix that by using the dev_err_probe method to print the APB/clock request error status. It will correctly handle the deferred probe situation and print the error if it actually happens. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko --- Link: https://lore.kernel.org/linux-gpio/20220610075152.10214-1-Sergey.Semin@baikalelectronics.ru/ Changelog v2: - Use the dev_err_probe() return value as the return status of the corresponding method. (@Philipp Zabel) --- drivers/gpio/gpio-dwapb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index b0f3aca61974..9467d695a33e 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -652,10 +652,9 @@ static int dwapb_get_clks(struct dwapb_gpio *gpio) gpio->clks[1].id = "db"; err = devm_clk_bulk_get_optional(gpio->dev, DWAPB_NR_CLOCKS, gpio->clks); - if (err) { - dev_err(gpio->dev, "Cannot get APB/Debounce clocks\n"); - return err; - } + if (err) + return dev_err_probe(gpio->dev, err, + "Cannot get APB/Debounce clocks\n"); err = clk_bulk_prepare_enable(DWAPB_NR_CLOCKS, gpio->clks); if (err) {