From patchwork Fri Sep 6 20:30:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 11136031 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E0CA51593 for ; Fri, 6 Sep 2019 20:31:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF6162070C for ; Fri, 6 Sep 2019 20:31:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rPdyAOLd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394494AbfIFUbA (ORCPT ); Fri, 6 Sep 2019 16:31:00 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39594 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391941AbfIFUbA (ORCPT ); Fri, 6 Sep 2019 16:31:00 -0400 Received: by mail-wr1-f67.google.com with SMTP id t16so7843914wra.6 for ; Fri, 06 Sep 2019 13:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hJt9ie/CwFH290nioenPt6TarTQUW3TGmI0Z2Dfa+bo=; b=rPdyAOLd/hWoLsxQzZ9HfJ2/dCFPB30qpT714bMbwc/FDbzah86xUPeIJBRsqB686W SDSiEx9979Um2y3wOzjNoLPHS9sMCGoeMJFAPqACQRwzY/uHDU0n6Kw6GvNBpB+rf9hL Ci1j3c4sDGeXmhlONiyPRyECkV93S9hInzibe/4/dW2uMCbWbxVVrBeg4fEHbdc3JkZz L9l3wtKtN1ONVcSyRnjDKrRlsP6tvRijb4ILVNCmTrzrjmlDVVz3p6EKLgpOyzpb4d5x 3jrKSbf0bg00KFsFKio7XtmkP945tosJHlEFV/pxv3TktTAxXHhUCDSXd5lZ632Crmb7 cesw== 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:mime-version :content-transfer-encoding; bh=hJt9ie/CwFH290nioenPt6TarTQUW3TGmI0Z2Dfa+bo=; b=PZlytGzKG1iTBriQCpsMaIvYyn3nh9d8YyotaczGBHa2OOXkIxDeMYQiLQZrii+/BY 5I/skektVUwnIrzwKiEj8QUdsrML/kIugOBRzrO+p0UeUHMPLXquhr0sqjro6mRBSz+M nBcp4GYXRIsAYSeVd9iqrfNLcQR44/Q4Yb0WygsJvxHJwpnmxTVkD+D3MdBsPUMmvsGw s4ZzvBi2ocW2u102F0gt+8rBemlTCTMaAQQvB9iQxfRNfR7hX/qx+27ftO4dD6eDmYkx bqChszbNvtm4LxDt7JNUcF9ko9nablOULHKoAv1+pBq4j39WXSvCLZ/uaGu87ymAsOy1 G+gw== X-Gm-Message-State: APjAAAVy2NOcmucuI811J8oiGSzJIK8mim7N9HkHQH1BjCk/BSDzivSP QN1ffE4XrzWSkdoWPhlZmgMPbg== X-Google-Smtp-Source: APXvYqxuOzF9/TIyDwhZSqjRscrY6obUNrkMCg4AQXNOlpchtwedBfAWLFypyYV788yUVPs7H1NO+w== X-Received: by 2002:a5d:6302:: with SMTP id i2mr9065964wru.249.1567801858400; Fri, 06 Sep 2019 13:30:58 -0700 (PDT) Received: from localhost.localdomain (124.red-83-36-179.dynamicip.rima-tde.net. [83.36.179.124]) by smtp.gmail.com with ESMTPSA id t13sm13330734wra.70.2019.09.06.13.30.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Sep 2019 13:30:57 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, wim@linux-watchdog.org, linux@roeck-us.net Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org Subject: [PATCH 1/2] watchdog: pm8916_wdt: fix pretimeout registration flow Date: Fri, 6 Sep 2019 22:30:53 +0200 Message-Id: <20190906203054.26725-1-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org When an IRQ is present in the dts, the probe function shall fail if the interrupt can not be registered. The probe function shall also be retried if getting the irq is being deferred. Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Loic Poulain Reviewed-by: Guenter Roeck --- drivers/watchdog/pm8916_wdt.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/pm8916_wdt.c b/drivers/watchdog/pm8916_wdt.c index 2d3652004e39..cb5304c26ac3 100644 --- a/drivers/watchdog/pm8916_wdt.c +++ b/drivers/watchdog/pm8916_wdt.c @@ -163,9 +163,18 @@ static int pm8916_wdt_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq > 0) { - if (devm_request_irq(dev, irq, pm8916_wdt_isr, 0, "pm8916_wdt", - wdt)) - irq = 0; + err = devm_request_irq(dev, irq, pm8916_wdt_isr, 0, + "pm8916_wdt", wdt); + if (err) + return err; + + wdt->wdev.info = &pm8916_wdt_pt_ident; + + } else { + if (irq == -EPROBE_DEFER) + return -EPROBE_DEFER; + + wdt->wdev.info = &pm8916_wdt_ident; } /* Configure watchdog to hard-reset mode */ @@ -177,7 +186,6 @@ static int pm8916_wdt_probe(struct platform_device *pdev) return err; } - wdt->wdev.info = (irq > 0) ? &pm8916_wdt_pt_ident : &pm8916_wdt_ident, wdt->wdev.ops = &pm8916_wdt_ops, wdt->wdev.parent = dev; wdt->wdev.min_timeout = PM8916_WDT_MIN_TIMEOUT; From patchwork Fri Sep 6 20:30:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 11136033 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D874A1593 for ; Fri, 6 Sep 2019 20:31:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB7A2214E0 for ; Fri, 6 Sep 2019 20:31:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="n+D8yGsx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731976AbfIFUbC (ORCPT ); Fri, 6 Sep 2019 16:31:02 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:41625 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392704AbfIFUbB (ORCPT ); Fri, 6 Sep 2019 16:31:01 -0400 Received: by mail-wr1-f68.google.com with SMTP id h7so6832514wrw.8 for ; Fri, 06 Sep 2019 13:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DSA+TZh6EFNutVoqp+yeNCXRU52ohS+l6sFwi4Vq/+4=; b=n+D8yGsxYXEEMK1jJ/ysdmtsbtc662AikRKLEAI9XjZGCMzjmhYhwOaRkSO/sU0X/O vcl14UlaTsYSUWdM0IwhAw1P6V2Rs1hLqS0F5h8M9m1e8xreTdJiQ7cCdYMkSRQF5X6a f7IZbgOYv8qjxRrhwx4d6CaGD4KiWNpSvLeXZQn7PkIkBN5Oo6G4BGFUyu0zOToxyuD4 NdPsXzskMlxdq66gCPoo0qfeKEvxJMu03RiQxiAD+SUvMFU668e5hdkwo9MhAlkV2N/D 2bauUat5BFh2guV3vQhaGduzVJ3csYtu+7e6qB58dO56MctI+qjqGttjIv4zxVCkOF0f IBvQ== 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:content-transfer-encoding; bh=DSA+TZh6EFNutVoqp+yeNCXRU52ohS+l6sFwi4Vq/+4=; b=YLRAbH6o+C8v3CJpt+cFYsRDQm03XO7qU1M30LphuNak5Mpt3bxDXHWwws3p1REibn wGKB+RBHyw3gObLBjvYfsUUjdfFXjPA2IjfRanmazOUz6H0OmwexQs/YPQwbXUAeDuqw AonvVx2vXftDzbrz5pDfz34K3YRof28v6GAX8hMDeZTmVzXBtjQGJLJxLPO2nbzpqf1V uWXljbv980X+62p1xB2Uqm9dZZEd2342rcHFR10tINuFuyx+1L5eGUAyZD+6iN8Oq20F 1jSwUzjxUxS73c/pvrjUDmxiDIuegipaAv1EPAce3Rl3gTkqJxXO8mpiy+lyT98/6ZEr otzA== X-Gm-Message-State: APjAAAV/9PUjTgqOkVTZ7oHkD7Kqwele4Yfp+Ws+M0f8VtiTbQ7dctWR Zap7/5JkiDZJ3HiTL6acQCO1zA== X-Google-Smtp-Source: APXvYqz4cAB6gd73DDi1KUZAD7ymLG7prdMzq54Mw0AS8Y5qQR1SGriwe/Mlb0xSHbPsf31iH1QpYg== X-Received: by 2002:adf:e947:: with SMTP id m7mr9119067wrn.178.1567801859429; Fri, 06 Sep 2019 13:30:59 -0700 (PDT) Received: from localhost.localdomain (124.red-83-36-179.dynamicip.rima-tde.net. [83.36.179.124]) by smtp.gmail.com with ESMTPSA id t13sm13330734wra.70.2019.09.06.13.30.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Sep 2019 13:30:58 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, wim@linux-watchdog.org, linux@roeck-us.net Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org Subject: [PATCH 2/2] watchdog: pm8916_wdt: fix missing include Date: Fri, 6 Sep 2019 22:30:54 +0200 Message-Id: <20190906203054.26725-2-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190906203054.26725-1-jorge.ramirez-ortiz@linaro.org> References: <20190906203054.26725-1-jorge.ramirez-ortiz@linaro.org> MIME-Version: 1.0 Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org As per Documentation/process/submit-checklist.rst, when using a facility #include the file that defines/declares that facility. Don't depend on other header files pulling in ones that you use. Signed-off-by: Jorge Ramirez-Ortiz --- drivers/watchdog/pm8916_wdt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/watchdog/pm8916_wdt.c b/drivers/watchdog/pm8916_wdt.c index cb5304c26ac3..b8d9df0f96f7 100644 --- a/drivers/watchdog/pm8916_wdt.c +++ b/drivers/watchdog/pm8916_wdt.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include +#include #include #include #include