Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2476359ybe; Sat, 7 Sep 2019 16:51:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqylxfjJuZiVltCcEX3t7qtR141KAuqKW+tf81xaGvCxnuMlSK1fXE7VrI4HyLGdAt/vFYFd X-Received: by 2002:a62:7c47:: with SMTP id x68mr19428031pfc.178.1567900267003; Sat, 07 Sep 2019 16:51:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567900266; cv=none; d=google.com; s=arc-20160816; b=Igfjhyn8BAw/qNZgPNlXz5dkuQF1RAncAZlHD0JocFFvTYKMpHISsQ2EXzwml6Aw59 N4bgMtFjsDhzz+yqrpDvrQDf1dO1zclQpynFMCaadjvkQCp2G29uWDDjdXLL7cXuDvSR /i4uWN6LEmw2r4OgtgZCBt35WSd9b1alE5kSJH7habJadZKz8AQUf3f8WI6mDGIQPZPp nENDs5Pgk0b6Y8lzT+/300TFEoDFZkaz50007/mMvjrXky4GG2gRlTGuBFafKa7WZ0yY jw+dlHerDL8AZiSymWaJVOUJkHZPRq/nYxrS6nVHIKinatgogy/D2LRyPO2/oaqg60dM 2f8Q== 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=q3SejeavrI2I8S2TQqeck98NGNiqW6K3BT74k1jBZq2buWyVimNY6V48cwUzpmoazl YX4q+AwTahAeh8l+PSdOdwYevvd7bEiYvx0sjLO+ipIRPZilbLyvxY7JuZVw3BI3EglO eyI/uMWwwFgG+jCPl+K9p35gjufK+uBOCe0dY7/MG14n8/Yu5vFwx1ay1A0XXFrXee5v 52VBTUbc0aJQucnEHD6GVA34K/YeFMMF5CzthOtslxuc/l8GB1gffKXf7WgwkH1p8XOW vQqRZIZYg/yZZQNrkABpCUXLofgLGyUimJ0GkkTCRM4TSYAl0FqaeVU6GCcTnMXZWFnT eSKQ== 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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 k33si8284870pgi.563.2019.09.07.16.50.51; Sat, 07 Sep 2019 16:51:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S2394504AbfIFUbA (ORCPT + 99 others); Fri, 6 Sep 2019 16:31:00 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41622 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731976AbfIFUbA (ORCPT ); Fri, 6 Sep 2019 16:31:00 -0400 Received: by mail-wr1-f67.google.com with SMTP id h7so6832483wrw.8 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=DWTKrOHDg6ZjZg4PEB8vPcUMVbWCLCZGLBSCnYV5IF3/015PqpSyyj3E/xNrUSM+y0 PiTWTPInNwTG70l+ByImZFnmtdyaOnN6zg7fBLl16+hVyQGRLV5WgXzpcqX+OZEeF1ol qVaLzSebwsVy7CjuToBpZvunW+bqP9JwdyAECTZUA4SH3Imony7Zdsf/9O+14XrLViGE +XJcEN8LV636EnfN13LtddIz4HCkkzE4WvOoLibOkN58nHkNbbom5Dd3pv564dnxSXGe c8/66cr943pQ3unGYbllbTj8BXY/cV5GjYV0IZxmHN9nJcOnEkiJWZhpnFzjpCIVQ7ip w9lw== X-Gm-Message-State: APjAAAXJNTHvf+EmHL6dndm+ZglpP2e0ElJeIVURu/Xmyc1lk7sqDe+M Wu+mL3AE0VRQ8bwItQ232FQ18A== 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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; -- 2.23.0