Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3818874iog; Tue, 21 Jun 2022 06:38:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uhT4z+4eARCrWym5ras8q67rnlfIDTi4Mjza51hKGwa+Y7LkymFAKLuwAr/oApDRZySqwx X-Received: by 2002:a17:906:c7c1:b0:711:d2e9:99d0 with SMTP id dc1-20020a170906c7c100b00711d2e999d0mr25939443ejb.639.1655818707208; Tue, 21 Jun 2022 06:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655818707; cv=none; d=google.com; s=arc-20160816; b=BnZQYX0k/n9H7mo3O1MWfGBTb/IHS13Cap2QT1bLcjh57XFH67/ZtdM0W82PHOCn+I mRVQ5Lu7IKo56WSolA0xRb8gRujMQnQ2TT2K8jrypTAQNBokyTOsBPv+dpv9eP3vUol0 jy26dwxrDyv8mmaSjiPNxm0kyNlEL+v+O2mnR6wRN9abVFavWblMZI/pZUe1U980kgWC poZ+kNjaeH9e404LnhcQXKp9NbdcfqCiNemYsuB9OrUWwKwSj9515flFyx0EtuG6UtRI XnoL9CTQfbCFM1MxU8D//SkCFAJaRvHU/nHU+xqIM8zct15iHKuWnkujSwy9mkll/3KI K6ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NQoC5p7iW+aG+AFDTsraSEP2ZDz2hNrWGzfktUdOsjQ=; b=eY9KpAPNSqcIWL3WrZODj3cZ5DY3ZDl6rrAU42mRsm5NOK+UGOLIkd5SoNnwdBiOmI GucODcO5yW1CAnsUERxoWCD87XeEUymAa2Ny0g4JJazAJXJenmn7JB5eb0ZO1YEXB7Zr GJrmjZ6mieK9aONhFoTYLyKe34TcqfXT6yyfjvbjztKjfjTPitqQtNnVxmzgxYcVu8nQ Qo8jDc9Z6XJI6BSIkCKx3UCxhFEc4R42JUsTmxVXAtUh9w7+8oQRb+/MddDa+34woTiT Szd/FGad+gvjS9gS7kaE5HPNtkIBu1Ujs4D82W9HbTxlER9OD08c92NlwViPOZkNlUXX pJVw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 n20-20020a05640206d400b004356442b3a8si1815130edy.177.2022.06.21.06.38.01; Tue, 21 Jun 2022 06:38:27 -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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351614AbiFUNPS (ORCPT + 99 others); Tue, 21 Jun 2022 09:15:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351236AbiFUNOi (ORCPT ); Tue, 21 Jun 2022 09:14:38 -0400 Received: from maillog.nuvoton.com (maillog.nuvoton.com [202.39.227.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4E51819C23; Tue, 21 Jun 2022 06:14:34 -0700 (PDT) Received: from NTHCCAS04.nuvoton.com (NTHCCAS04.nuvoton.com [10.1.8.29]) by maillog.nuvoton.com (Postfix) with ESMTP id 386E11C81185; Tue, 21 Jun 2022 21:14:30 +0800 (CST) Received: from NTHCML01A.nuvoton.com (10.1.8.177) by NTHCCAS04.nuvoton.com (10.1.8.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 21 Jun 2022 21:14:30 +0800 Received: from NTHCCAS01.nuvoton.com (10.1.8.28) by NTHCML01A.nuvoton.com (10.1.8.177) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 21 Jun 2022 21:14:29 +0800 Received: from taln60.nuvoton.co.il (10.191.1.180) by NTHCCAS01.nuvoton.com (10.1.12.25) with Microsoft SMTP Server id 15.1.2375.7 via Frontend Transport; Tue, 21 Jun 2022 21:14:29 +0800 Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id 6AF8863A23; Tue, 21 Jun 2022 16:14:27 +0300 (IDT) From: Tomer Maimon To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , , Tomer Maimon Subject: [PATCH v4 09/18] reset: npcm: using syscon instead of device data Date: Tue, 21 Jun 2022 16:14:15 +0300 Message-ID: <20220621131424.162355-10-tmaimon77@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220621131424.162355-1-tmaimon77@gmail.com> References: <20220621131424.162355-1-tmaimon77@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 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"}, { } }; @@ -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"); + gcr_regmap = syscon_regmap_lookup_by_compatible("nuvoton,npcm750-gcr"); + if (IS_ERR(gcr_regmap)) { + dev_err(&pdev->dev, "Failed to find nuvoton,npcm750-gcr"); + return PTR_ERR(gcr_regmap); + } } /* checking which USB device is enabled */ -- 2.33.0