Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp374238pxf; Wed, 31 Mar 2021 05:44:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYLDXRqlHh7/f8Hd8I+5QvcygyDrNCyzmRSDDS6pxnLKL0n16We06XgjJc6PBVW37eizQo X-Received: by 2002:a17:907:68a:: with SMTP id wn10mr3374569ejb.551.1617194690398; Wed, 31 Mar 2021 05:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617194690; cv=none; d=google.com; s=arc-20160816; b=fvDZ0/qTU1neGALt/MgbtkdUdMLGsQftNWEVNgdRQSEgAv6fKq9PUabUNTX0Y/sG3M ol7gCvZL9Tg/4bTQNw3MWJ0LRSX+ntc1iujnghkRmx5TrMz29nc6HIUe3vNRZtx+7x8U OJMzAkSfkzCKvCq2A9yhEhLCKqoLjNyCe4DfqyuSJ1o8+JzGzk9GT9eUxA/Aizg2TOhn 09tndZMzSx6kQY/B6uYfYy8ddoas1JnDjyUplT5rcjwv2bSkFj5t6BZBPY7E5DPUpRZB 3wF17Bn5jIq1D4YgT8eD/sGdbsrRzBHrvoeIAYpS3kcMw0rqOq+g/A0vz7H8paaJy1jY 4aug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=n5asSzSMlsy/IJZzODnlLHF4/c6NSbP5Xn/BE7oQWnA=; b=R8PUzlI39X6nHBsJn2KEesy4b0ReXwQzGKCp4l7IfvkIXwbrMSk2nE7K3ct08Gi4A8 dzeHY7uc+c7WkzjP6PTgOTfsPiOnHgW87QfR/g9JPnpJxrzuxzUN9qRKDWuq23YJT1NQ AzpHGY9DwHqACHsAu5doTWzB6RHl/sOY6baCg3Rgm2geKNzfoKgL7Ab12Zs8KLmcYV7G hzhH1IKfmj8p9CK75Rw4B9u8CkC8pm2M5HI/vcdmYINWz33aZg2EFmf9jcpbhBem89fV XkVIes8MxYTxDSDHPpeTI95oLBGXGw9sTw0IT5Bu+2Dx5A3FGYzT5LzGXkqVYKLyUAxJ QxPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SygpZcKi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b3si1582386edy.588.2021.03.31.05.44.27; Wed, 31 Mar 2021 05:44:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SygpZcKi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235564AbhCaMkg (ORCPT + 99 others); Wed, 31 Mar 2021 08:40:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235506AbhCaMkI (ORCPT ); Wed, 31 Mar 2021 08:40:08 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59526C061574; Wed, 31 Mar 2021 05:40:08 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id x126so14417497pfc.13; Wed, 31 Mar 2021 05:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n5asSzSMlsy/IJZzODnlLHF4/c6NSbP5Xn/BE7oQWnA=; b=SygpZcKiL+DOu+eqMwZDoTk0yxjQ0ThJvSXaqWP3bxzedWk3biiknUZg4cDp/at4FR oUNQlsmPyIcmrzClkm6XA3NxzWpQuNC9Ur+sNIq/jzlxHNmBoOGxGS0s6ZP4y2xXnr4u kbyJQtkbCcnuVWGZmA/mCOTVzGPdfxQCxF3Mc94UlPqxxrmZH+t/aBh88QOqgWWHm2T0 T/F53OiOkY9JVokhXrdgq2aMRRfxvNdiigMCOwU7vZIWZ7HgJP4feP8lEjdKyt+ciAR0 RTNMs/VKssSMetfBusuHf0u38Mqx63Hj7B2oyd3jBBxaHxaRbFxmFkCQebKz1oveA9Xw CsuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n5asSzSMlsy/IJZzODnlLHF4/c6NSbP5Xn/BE7oQWnA=; b=ZD9H6I8WsopafEcOj40yMng6cVH4YQLmfTJ/RB0xXFcAVIzsxJsAf6cXXK2/x6Oi61 RD36z8cfUXxJlaMNT3fUQEwAQVyUdsDD4RN+Q4mu/q/1WmahPm4zFLIl1r5YOqmTko4S Oo8bHvfGlLeAVzijRHnPxuEGfF69gvd7B7jrVZEUV/v7FAnFrLmWTeAOuDfjyVdwkczn 3MWFGQLptNX+gjxk6cQNROzC5Zy24upSldelTeChpJos9XUzpYheV6RudPVrN5RTLudG 0leRxLgJzVcbYC8AKYsxEm8DFP1fipZKQVAdi0+mQPvDOvkWqhUtWDlLKG/VKkPJ/yJm tp5g== X-Gm-Message-State: AOAM5328Ei+EIhobu1sbaoORjy+vZnHUeq/qLnee+Yl7qwB9lboNxNK5 d/uSq9ghjI1jxulzrydrhewSJ3nVU+cM0vwhwRY= X-Received: by 2002:a63:cb44:: with SMTP id m4mr3137446pgi.4.1617194407960; Wed, 31 Mar 2021 05:40:07 -0700 (PDT) MIME-Version: 1.0 References: <11a8323c249ae6ea7584402ab0fb74551b6a4b7d.1617189926.git.matthias.schiffer@ew.tq-group.com> <4c143c8ee65fe52840ccbb4e1b422b6e473563d9.camel@ew.tq-group.com> In-Reply-To: <4c143c8ee65fe52840ccbb4e1b422b6e473563d9.camel@ew.tq-group.com> From: Andy Shevchenko Date: Wed, 31 Mar 2021 15:39:51 +0300 Message-ID: Subject: Re: (EXT) Re: [PATCH 1/3] gpio: tqmx86: really make IRQ optional To: Matthias Schiffer Cc: Linus Walleij , Bartosz Golaszewski , Lee Jones , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 31, 2021 at 3:37 PM Matthias Schiffer wrote: > On Wed, 2021-03-31 at 15:29 +0300, Andy Shevchenko wrote: > > On Wed, Mar 31, 2021 at 2:37 PM Matthias Schiffer > > wrote: ... > > > - irq = platform_get_irq(pdev, 0); > > > - if (irq < 0) > > > + irq = platform_get_irq_optional(pdev, 0); > > > + if (irq < 0 && irq != -ENXIO) > > > return irq; > > > > This is a dead code now. I suggest you to do the opposite, i.e. > > if (irq < 0) > > irq = 0; > > I don't understand which part of the code is dead now. I assume the > `return irq` case is still useful for unexpected errors, or things like > EPROBE_DEFER? I'm not sure if EPROBE_DEFER is relevant for this driver, > but just ignoring the error code completely doesn't seem right to me. platform_get_irq() AFAIK won't ever return such a code. So, basically your conditional is always false. I would like to see the code path which makes my comment wrong. -- With Best Regards, Andy Shevchenko