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: 173300 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp1214279ilq; Fri, 6 Sep 2019 13:31:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzf2nTYaUlpCRobzSVX5nuclOAIHHmNmSDODDEh1a/2bTizAM5S1FEYn7btcvIiNvMKSvR3 X-Received: by 2002:a63:460c:: with SMTP id t12mr9523121pga.69.1567801860874; Fri, 06 Sep 2019 13:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567801860; cv=none; d=google.com; s=arc-20160816; b=vpESaCSd1vSDMwPv6wbPGxCgx2O/cZ+3RpkHw2vbMl/4A+g8klTJvzmccajSUjDdNF +RSb3ooMaoJK51z49up3PBpl3A7Fyz/NepLvqjZWGbYB2InbwB0kVSznjEjSUT48ZENu mq35HOVVUzgw1cxHR8z3N4n8ymV+fZva+s5hxSxsRQ0wJapsGTLU4Fo+js8UvyfHQ1jN fNPs8buJa4MqMH8Mhh+TnkhgOCMAoggbgnhvB/UaFu2eRq0TFCuOp9Y/OR4VOzv33tBH 58P0WDPZO3zVAMfrHoo9tYKyly0AoOV9XBEy8GTXP/yqx6fvGg3E92IlWAlpKKLBWhlU wY/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=hJt9ie/CwFH290nioenPt6TarTQUW3TGmI0Z2Dfa+bo=; b=Q8EWDx3+02yc46pHe4WwsnvWgpudlr6lwD9tsFejqi20DH0q4+3RX0a1bVVlhKlP7c PxJEuAkZW9gCnsX/B9O1pQR53IOxSGRjcxW33R4Y5thlNLqIZdIMlnEPF06+J0+tRptK dkmH77cTLLWL51zSazAc0X+B2q50dx4vcvOOntRhl70+e2wpjG3EUSK9nwhDC4wsTWOe bdO0vP/Sy2/okfSU0Liq8fvFUcsWrkFHei3kC2NgFW7GLg1Ct6clVbjKuFNtO4L9Bpz2 c5VCA6UXn5RbHDfo2i6l2XIm/U4WsVDSYrUaXdbo131xq6jjRIrJ1VXYgLBJEXT955jT MuSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rPdyAOLd; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2si5222192pgp.475.2019.09.06.13.31.00 for ; Fri, 06 Sep 2019 13:31:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rPdyAOLd; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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-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 --- drivers/watchdog/pm8916_wdt.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) -- 2.23.0 Reviewed-by: Loic Poulain Reviewed-by: Guenter Roeck 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;