Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp757024ybe; Fri, 13 Sep 2019 05:56:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBHjpV7pLgMByh2tn7fguD7gZdD2VAgYFsqMI4WnVcui3PuYlpNLr/8miZ/J25q+FcYpoy X-Received: by 2002:a50:e806:: with SMTP id e6mr46357583edn.162.1568379406119; Fri, 13 Sep 2019 05:56:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568379406; cv=none; d=google.com; s=arc-20160816; b=GRyzXtwf9A0oSrErZ8gK7YlYjjOU1vXRtV+pc0MF1Ku4lzOmXT9rUkbnl8Ej9tgrf+ FwM08+ACBI2GjPcG0ul6qufJGuiknKKD2Y82fs58DuRgyFzzxXhYPvo1su8QF36ReWhq NvF4iICID5bsdShNpsTtodfpiPyiI6/+eWXzHbnD3A1UIwUpvrUmrlxf6bsGoCwehF4k XwMrufa5VKgbS0lftAvF44ZS7NgWoouRIkAPf8pFGiYd4LvP0FamB7oF6d/9CTX4o5oF cFZTKaWFZaIXP3Gx0mVrBlI+e1dTSb6HYUTsDfiJtbFLG1IhxQEy/7RTJeHZZPSlFtRT QPhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=BlZu7IMkJJ2x30qqdls5PsoF2ZWD58HPtmFSp7MDs2k=; b=EqT0BgJ+dqjajAEoEgtntriSFI5mw9osn6RZwjP7OEBhYAMPiOBcdhNPh6vAhzGlAt ZHI1C9jFf7ZspgQnTME0olvWUlZgeGFC5eeLgaNfFP8bfpfDN8jCqsCmCGJ8rxBE2d65 FDpnzbwPwc6FZ94upnWE6QLqCOGwvl8c0iXBwyZ4vOUokuoSBu3ViaYunjES+VsYK0q5 rHLLAJ3Saiowqsyqvl/7lQm/DpJM6lEZ3y2uuXQ5wedcKIpYT9U8UyWq60T/GhRr5CB8 o3Og/RZZS8VbkzD43OjObo/uW9q3mbsh9t+LRxNp3nDkUJ0SC4FcZBXjoyav6Q0Z6yaZ 6N3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=kFdb5zkO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k23si14302874ejr.329.2019.09.13.05.56.22; Fri, 13 Sep 2019 05:56:46 -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=fail header.i=@gmail.com header.s=20161025 header.b=kFdb5zkO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729865AbfIMMwf (ORCPT + 99 others); Fri, 13 Sep 2019 08:52:35 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:33474 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729558AbfIMMwe (ORCPT ); Fri, 13 Sep 2019 08:52:34 -0400 Received: by mail-pl1-f196.google.com with SMTP id t11so13206987plo.0; Fri, 13 Sep 2019 05:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=BlZu7IMkJJ2x30qqdls5PsoF2ZWD58HPtmFSp7MDs2k=; b=kFdb5zkOXd5y0cnDElxLxkNkj3H/77rTt5mQnZ3elYPwnT8P8Hrd1EjosCLZtj4tP4 2xNHXUfkpFJ3ZcDloXG2fql3zkhJSdqI0QymoBDm7N2p1o6VM4L/NHT0CtpKSOHbe573 pB7oc5a3csyZjGfckA5BXuo6BN1eAVtpQCWzMiiZIYncpPAUJ1wvtJlNTcJQh5gNt1n7 QuqR5wgtG8iqQv+kmkyvn9NrDb8FbGlHopTaBS5OYaUzKLd5RT/G2RWPkQqhFr14Q/el hDwqsH2o4FltSZyafQcpRDOn/fksXbmOQERM6uUWDg6tfyHMpvFsEWLCgceYS/eENozt SNqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=BlZu7IMkJJ2x30qqdls5PsoF2ZWD58HPtmFSp7MDs2k=; b=fTca09TUuq9+AYfu1bG9yOKuxDxje1PLlvEcgTkwxVNd8EdOU3kVvO6NeWYO5K5PtG euhakeY5fX8FYmEhyHujYeC4bSPAoZX0NNgo3yTfOH10lIJd33vJeUmwPlWjwxxgJWri yO6y9d3rGSOEMScogz9q+qX2XpyuScEJHySnnY3w1rLJqLlex3Pd0kWWDpGBhfStPRnb qinazLwoPOW3pEhO/3ao+BIIIRx8VIaqEVl2nhT6Ek6gckpMRB5aWnuOB0n1u7rExMxx Ab1mKG6nwjkmi3imHRcQezK6zgBdOqfCEHi3szS/c4QR3cecGQM3y9hvBwLDMy9mgm5W 39HQ== X-Gm-Message-State: APjAAAXw0dvlRQ5ah0OJiUJ+1s2DEgMkop7fQuDH+GxVe8h5BZXh1hqK i6r4A3eypoTng5Hb6CGsFzppKtCw X-Received: by 2002:a17:902:aa48:: with SMTP id c8mr49143964plr.330.1568379152495; Fri, 13 Sep 2019 05:52:32 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id g12sm6707212pfb.97.2019.09.13.05.52.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Sep 2019 05:52:31 -0700 (PDT) Date: Fri, 13 Sep 2019 05:52:30 -0700 From: Guenter Roeck To: Jorge Ramirez-Ortiz Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org Subject: Re: [PATCH 1/2] watchdog: pm8916_wdt: fix pretimeout registration flow Message-ID: <20190913125230.GA18629@roeck-us.net> References: <20190906203054.26725-1-jorge.ramirez-ortiz@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190906203054.26725-1-jorge.ramirez-ortiz@linaro.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 06, 2019 at 10:30:53PM +0200, Jorge Ramirez-Ortiz wrote: > 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 with nitpick below. > --- > 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; > + Unnecessary empty line. > + } 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;