From patchwork Mon Aug 26 18:21:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 830 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 0F6963F0E1 for ; Mon, 26 Aug 2019 20:21:28 +0200 (CEST) Received: by mail-ot1-f71.google.com with SMTP id 71sf10582150otl.5 for ; Mon, 26 Aug 2019 11:21:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1566843687; cv=pass; d=google.com; s=arc-20160816; b=QczieYynHsS+afcThhoc+IMivbl8mXTuATzw6zB3jwomYSmtoksKhgUBnZoI41Y65u 0NRtOoDWabl2YtXbvKac5zdO0A0O/KVaPop6mt2gFz4ccLrfEiY5hXE64ULo3UwGCgXG lJ04AGZR7XDMr2ertjBx2dNNjn+nYTOhg73xD7v02EFcosjUrE57Cd98RPyue/LNHtHJ uXv+V3Gy/AiIgiBWyCk9mx8i7AupdL6n4XGUNaPTnCJUGtjEQnwF2KzwwZ/urWG5e45O 05ORmTivWI0OJpw1No+HJVuSU/7AkjuWVdtr0yTEMSI2szlKfS++XsNsmFIX5grJOnYc wV5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=BwSMowhkOcHUvkKD3km5AkrSTcx7c+Ou7k7Jj1uGJiw=; b=RNJgNOEdepzdrI/DY0Knt1GwqIIlplFHebgmthfDgrZ16bVLRWhpyYmcN6JRbeqpcb dl7LXMD87IcknuJORiVdoFVTvaXzYcXro1FbJV6yaAsoR2EfnbniW9gTlyWmHlCKMxic FeDdES+fkIP6gXWMV8CYiz08Ggx0g2vqa1nIrqly9HLXUi8SRMc50cpMk/1F90h7dtBD tR+GxcvsW/VkJ7CtIZctFO8Fdgtw/Nxg8KhZ0O+eANybjI+nGVSiGoRXBQwKlZ/rEURx qtWyK1Sk1LAT7yCeLRz7hBlHH5WlarxbcC20QqbIReHKIEk9W2QDEVn6DvG6EvQjL/rm jWAw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Tk2a6UaE; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=BwSMowhkOcHUvkKD3km5AkrSTcx7c+Ou7k7Jj1uGJiw=; b=S7doqCnLr125H2L5H5JcbnKnlWewp0KCvl4Gzyg2asCcCmAI2YcHTK29I1o1VS7yby NO7nCSMc5WAEloS5/sY2ePEpuRyiCeiGPB1Zbv0Ovg2Kg4lf7LcDeO3Uye+6XI1D2l1i eAqVT/bRJ0DsvWhBdXFQFviLNynkYB68IViTQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=BwSMowhkOcHUvkKD3km5AkrSTcx7c+Ou7k7Jj1uGJiw=; b=MOX2wjH7gtUVhxHOYRSkXd3gznA/B0ImRp/H6GkqJuywLhu83Cu19jaP+sSyAI4TxJ yfJ4LmPgWF7XNgB/h86NGJLYxWN9CWcWPnur2SuRr504Nlxu6wIEVCwt7Z21lCqHkDTN FKKndvhkR3fFm3Z3RTtCmkcCuc8Rzl5wQzaXeyaEHVDJKMwLs9NXnJtdufSRzu+ZimkC /2eZ30gmJohuKq4jv6MgyfOIv1jJDq4681X9gyxBtS6cLsLwT6s8tZ8MpAfbB2Q4mgj3 aYeVMn3c/TbZZui6Ob8iCr7Q0wbBywfFjzQp8oKbebK6kchHczKdAdQII3tRszSNUV4V MC9g== X-Gm-Message-State: APjAAAWchlLAjY3TInP6K9m3h71TqUytpECtnCso801aS7aV2pFt8+NQ evtYoBcbYhPFXQ+F7n8XZAj+euHv X-Google-Smtp-Source: APXvYqwhBUvV3dCgf87qwN61oyCFcDR+c7sL2PEC1kwcCVvCqqvzjiTsVk21HY9sYPzX+RlBJcwN2A== X-Received: by 2002:a9d:20c3:: with SMTP id x61mr16347052ota.289.1566843687012; Mon, 26 Aug 2019 11:21:27 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a9d:70d2:: with SMTP id w18ls506296otj.11.gmail; Mon, 26 Aug 2019 11:21:26 -0700 (PDT) X-Received: by 2002:a9d:7516:: with SMTP id r22mr17440032otk.151.1566843686689; Mon, 26 Aug 2019 11:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566843686; cv=none; d=google.com; s=arc-20160816; b=tr7kEIUQgcY/P6PvzDVLyNLZmCGyJ3MwYTSTwnWwubilpDehgfkLyuqKo3b3BvFKNI R+EwavacAqYQmABkyZBHhxzrqxnJuSp+mWeIFVnRoseRA6UBgWpcWJ4amQkVGjxC0cF9 iD0PScSyugjQg5zWp6fGyo1vgQn6fqzTaMuenL8RnWViDtTViOMT0ipcQ9bEAic1WgJI mHmA/Ye/4XrDRp7IKlzWHl010W7XsHSm96dT0XX0TQ1p/DSwTlpBN69ffcu3I5qYv8Yj i+Wa/3jh0CIODzg4UvYzR8BaT8RR+3wiuUCN+p6F0LnecD39DRu6hL0vkFTJNi/T3sT/ DqLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Wq6GJCz6OpwvPx36T+BmHN2obhM+vzYcJ0vK8rO0YF0=; b=x//9dmONevcmmpUW4/DAXwjySY0RgTrtx9nC1eLkTEWiiTju+pFF4lO+ajdC/hqKlv 7/3LjOAczZYWof7qwQLe+2bcYMczJs5uPhD4eTGvzPcI7yQvj3wYH0KiimBMehbsQogW Jcfkw7bNL+1dtb90pPLfjIDHVSnpk5jvF1yxeUYssHb7ITid8nHYyOvpFn4F6eHv6ghF 1GA51ciFfe2VVFgywpxlYN7IRBnhuFZ6/N51CycYJ+NFrnbf4TrMfD5G0cI7Wubd5UAP ZNrvC03ngMYeceFS+kJ3zy8kv6hASZburR/THsH3wFN4RZfORbTr+WGDpfNjwPXc2Xfj Y/QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Tk2a6UaE; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h81sor5075188oia.128.2019.08.26.11.21.26 for (Google Transport Security); Mon, 26 Aug 2019 11:21:26 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:aca:4e0a:: with SMTP id c10mr12953762oib.61.1566843686355; Mon, 26 Aug 2019 11:21:26 -0700 (PDT) Received: from jagan-XPS-13-9350.attlocal.net ([2600:1700:7430:38e0:d5b0:4823:33c8:5e46]) by smtp.gmail.com with ESMTPSA id c11sm4401461otr.54.2019.08.26.11.21.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 11:21:25 -0700 (PDT) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Akash Gajjar , u-boot@lists.denx.de, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki , Chin Liang See , Andy Shevchenko Subject: [PATCH v2 05/16] wdt: designware: Simplify is_enabled function Date: Mon, 26 Aug 2019 23:51:00 +0530 Message-Id: <20190826182111.30999-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190826182111.30999-1-jagan@amarulasolutions.com> References: <20190826182111.30999-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Tk2a6UaE; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Right now the designware is_enabled function is using numeric number to check whether watchdog is enabled or not, so use register macro and check the same. Cc: Chin Liang See Cc: Andy Shevchenko Signed-off-by: Jagan Teki --- drivers/watchdog/designware_wdt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c index c668567c66..bd858f0608 100644 --- a/drivers/watchdog/designware_wdt.c +++ b/drivers/watchdog/designware_wdt.c @@ -45,9 +45,7 @@ static void designware_wdt_enable(void) static unsigned int designware_wdt_is_enabled(void) { - unsigned long val; - val = readl((CONFIG_DW_WDT_BASE + DW_WDT_CR)); - return val & 0x1; + return readl(CONFIG_DW_WDT_BASE + DW_WDT_CR) & DW_WDT_CR_RMOD_OFFSET; } #if defined(CONFIG_HW_WATCHDOG)