Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp502354iog; Thu, 30 Jun 2022 05:08:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vW5eWt7hBLRoX0HzOaXratJUyEvokG2OrRYMod/UMOtM0eJQBrNhjfvqgnBykeTgtWTEUU X-Received: by 2002:a05:6402:2404:b0:437:d11f:b9c7 with SMTP id t4-20020a056402240400b00437d11fb9c7mr11247078eda.176.1656590885261; Thu, 30 Jun 2022 05:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656590885; cv=none; d=google.com; s=arc-20160816; b=HeN4WwfInxw4Gk92SblEtkjJOMLzQob5GgVdIcO/j5ZwZdYjZRRtQgEzlhPqS6YTIz pxn8uJ/7uu7WDPitGmFGc433afkwTSvG6u27vCDfgjOMcAwjHQx+5w3p6rcDyuAuGXGW 8u9uOWHLGVIs4rQYwC1ip4TBMI6B4/Z4E/c0PSJ3wx1Uz8tXuLJuaRYUbxThwMpYSdQr I9FOGo4/J288Nfia1Mm9UKrVlKU67f5uYN3bpNqg7K7nw5FCww4eK20SPhkiDS+1PWWv agBMt8rbdV0+hrbtnEnqSezX8ptkM3ICHJ0wrBp8gTRZz3UBpx22kcoIzUAiFjOvqV9G 7ljg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=F3z5vFPzEHYOTQK4dAz/8T9O7wftcSUcZ/VZVshv+x8=; b=h6avWTQdTbwB3Sat4P0hxiuDBIKouMocIvVrCqjS2NWCSEMEQttQQRMJ2ioSecmpC5 CskQqY6zTQkED3St3JJ+ycRGVNGvoqe5Cxc8AIO8TNexuFgAEl32hgKRDm/39oseEXyY PN+u4Avr4jEm30uY2M1d+QJ+ti0cfv8nTcaY6SbIgPEo9QN0oaladO5BU7Fi6zInIpgH q97JX4Xjxq002JDBtw5HqHhbYvTQZAyBwzbvRLQVcAgL5NUgQgTO/DFDJKRluhUvWdqT rNqw4Jp0Qrrg/zPriiTDiJsXuaZEyP0Q2mwCOWLgIcWuPKbWSG6mUmuq5M+8FCd9eFwD JMqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AGHLlGOG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y19-20020a056402359300b004358b1a8fabsi26086217edc.154.2022.06.30.05.07.40; Thu, 30 Jun 2022 05:08:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AGHLlGOG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232771AbiF3LU7 (ORCPT + 99 others); Thu, 30 Jun 2022 07:20:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234657AbiF3LU5 (ORCPT ); Thu, 30 Jun 2022 07:20:57 -0400 Received: from mail-ua1-x932.google.com (mail-ua1-x932.google.com [IPv6:2607:f8b0:4864:20::932]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EC8C4F64E; Thu, 30 Jun 2022 04:20:56 -0700 (PDT) Received: by mail-ua1-x932.google.com with SMTP id b2so329036uaq.8; Thu, 30 Jun 2022 04:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F3z5vFPzEHYOTQK4dAz/8T9O7wftcSUcZ/VZVshv+x8=; b=AGHLlGOGhO0C6LP/EywIiPK3kp69qKznp+IwV4eEgAbF7QdJCbcvAbBmWXWragOp8N /4t3JQ2nFEINqZT8Uo7vC6dJoxT0WQCTBqevJ/f1fUwPj3NpO0pDh8GZ7yBJ72jK24ei vroPJiiirxt6iCmJBo5HSm0TNZdTYfvfSKuid+Gic7ZUonJ62jzi3wIdgY/ka3AcNIss ajD9cRvqTOGgPXElDZnLNDd4hoWe+8ZalbX1iZMuHebkmD+hY5FScbVSj0pzFOWo1vZc jw1P4uLQJx3Ht4OQxLDjH0TqDcmA71bFxaf3ZzOxwGV14WlJ5d5c0G2/JC8MOtHBIOWz nMhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F3z5vFPzEHYOTQK4dAz/8T9O7wftcSUcZ/VZVshv+x8=; b=d/DReOV7tCKTHXgQUjFzkqF9/9+OEAyBVPWkL6+xKoF8yBTfuFHOZIMh2Cvn+FH8Vw iZVpjxM1nTuUB46YvT/bQ0f03AasNYb+2ey9pHtyqluetI9l8Cfmo5Ny3l3iWTnPAiHV SyWVO4sSq9T3SD/8oA0IpJOwvxcEyaYmp3aZA8dzsh00LVvwoWtBpm114zfE3TaHiMUw yjpfLY9SIvortxWCxFn7UAHeraGaLub6H3RCFB0RyRvgrpIxNhKxdPEdAc/GMB68iXhF T3qailow5fzPlFx+qTNoY6DmeNV9A1aUQwpaVkGG61dCWtsF5ki9fBs/mKcKK6IyUVOY PY7Q== X-Gm-Message-State: AJIora/ZxVI9ZSu7U2exbxmdx2VNz/fPy9rNHimzu0TjpAci/TJepclw 4tQGmPrz87sWpcsNEpcw5sgmzM78Rlyt/iz0qF8= X-Received: by 2002:ab0:2790:0:b0:37f:1d08:c2b8 with SMTP id t16-20020ab02790000000b0037f1d08c2b8mr4309598uap.107.1656588055298; Thu, 30 Jun 2022 04:20:55 -0700 (PDT) MIME-Version: 1.0 References: <20220630103606.83261-1-tmaimon77@gmail.com> <20220630103606.83261-9-tmaimon77@gmail.com> <63f8d70ad9c657890669e9c32775632af4e36995.camel@pengutronix.de> In-Reply-To: <63f8d70ad9c657890669e9c32775632af4e36995.camel@pengutronix.de> From: Tomer Maimon Date: Thu, 30 Jun 2022 14:20:44 +0300 Message-ID: Subject: Re: [PATCH v6 08/17] reset: npcm: using syscon instead of device data To: Philipp Zabel Cc: Avi Fishman , Tali Perry , Joel Stanley , Patrick Venture , Nancy Yuen , Benjamin Fair , Rob Herring , Krzysztof Kozlowski , Michael Turquette , Stephen Boyd , Greg KH , Daniel Lezcano , Thomas Gleixner , Wim Van Sebroeck , Guenter Roeck , Catalin Marinas , Will Deacon , Arnd Bergmann , Olof Johansson , Jiri Slaby , Shawn Guo , Bjorn Andersson , Geert Uytterhoeven , Marcel Ziswiler , Vinod Koul , Biju Das , Nobuhiro Iwamatsu , Robert Hancock , =?UTF-8?Q?Jonathan_Neusch=C3=A4fer?= , Lubomir Rintel , devicetree , Linux Kernel Mailing List , linux-clk , "open list:SERIAL DRIVERS" , LINUXWATCHDOG , Linux ARM Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Philipp, Thanks for your comment. On Thu, 30 Jun 2022 at 13:59, Philipp Zabel wrote: > > Hi Tomer, > > On Do, 2022-06-30 at 13:35 +0300, Tomer Maimon wrote: > Using syscon device tree property instead of device data to handle the > NPCM general control registers. > > In case the syscon not found the code still search for nuvoton,npcm750-gcr > to support DTS backward compatibility. > > Signed-off-by: Tomer Maimon > --- > drivers/reset/reset-npcm.c | 17 ++++++++--------- > 1 file changed, 8 insertions(+), 9 deletions(-) > > diff --git a/drivers/reset/reset-npcm.c b/drivers/reset/reset-npcm.c > index 2ea4d3136e15..431ff2b602c5 100644 > --- a/drivers/reset/reset-npcm.c > +++ b/drivers/reset/reset-npcm.c > @@ -138,8 +138,7 @@ static int npcm_reset_xlate(struct reset_controller_dev *rcdev, > } > > > static const struct of_device_id npcm_rc_match[] = { > - { .compatible = "nuvoton,npcm750-reset", > - .data = (void *)"nuvoton,npcm750-gcr" }, > + { .compatible = "nuvoton,npcm750-reset"}, > > Add a space. ^^ Will modify in V7 > > { } > }; > > > @@ -155,15 +154,15 @@ static int npcm_usb_reset(struct platform_device *pdev, struct npcm_rc_data *rc) > u32 ipsrst1_bits = 0; > u32 ipsrst2_bits = NPCM_IPSRST2_USB_HOST; > u32 ipsrst3_bits = 0; > - const char *gcr_dt; > > > - gcr_dt = (const char *) > - of_match_device(dev->driver->of_match_table, dev)->data; > - > - gcr_regmap = syscon_regmap_lookup_by_compatible(gcr_dt); > + gcr_regmap = syscon_regmap_lookup_by_phandle(dev->of_node, "nuvoton,sysgcr"); > if (IS_ERR(gcr_regmap)) { > - dev_err(&pdev->dev, "Failed to find %s\n", gcr_dt); > - return PTR_ERR(gcr_regmap); > + dev_warn(&pdev->dev, "Failed to find nuvoton,sysgcr search for nuvoton,npcm750-gcr for Poleg backward compatibility"); > > Is this warning useful to the user? Maybe add suggestion like "please > update the device tree". Also there is no further message if > nuvoton,npcm750-gcr is found and all is well. O.K. I think about two options: 1. Modify the message "Failed to find nuvoton,sysgcr property, please update the device tree\n Search for nuvoton,npcm750-gcr for Poleg backward compatibility" OR 2. if (IS_ERR(rc->gcr_regmap)) { dev_warn(&pdev->dev, "Failed to find nuvoton,sysgcr please update the device tree"); rc->gcr_regmap = syscon_regmap_lookup_by_compatible("nuvoton,npcm750-gcr"); if (IS_ERR(rc->gcr_regmap)) { dev_err(&pdev->dev, "Failed to find nuvoton,npcm750-gcr"); return PTR_ERR(rc->gcr_regmap); } dev_info(&pdev->dev, "found nuvoton,npcm750-gcr for Poleg backward compatibility"); } The only problem that I have with option 2 is if our customers will use the latest reset driver and they will not update their device tree they will see all the time the dev_info message. What do you think? > > regards > Philipp Best regards, Tomer