From patchwork Mon Oct 22 02:55:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 10651681 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9594C174E for ; Mon, 22 Oct 2018 02:55:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C5A727B81 for ; Mon, 22 Oct 2018 02:55:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BD3A28438; Mon, 22 Oct 2018 02:55:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D5ECA27B81 for ; Mon, 22 Oct 2018 02:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Jh3QuLXssgnsqJmQLhC0bvtcrHoPK0TBVesIWLgMhPA=; b=B5fvrMS8/5fUH8 LLtlzEIZQ7pH/xAt3WGzTiM9+wAuCBabABLxURA4IaO9TDKQEfNi9cU95xXRSK6jRSaw6zZ30PAK6 S7DfPHDX2rC4vD/arHed8y+qoBMdi/rQfhufUqHRUaPjY3Mf/DNIhEim65jd5rRGuOfQMkjRAyVui +Zfit5o6g8SSNwbgUUjYC1FC1BF8twVlEvrfVKANjYzKx/NFwjrWAGIXw/i5A+Tw2z1RsB0RQ+raC jWrq3IqnhzzP/7gKKGxodnaVb+IIBJhCXd1/B0LLPWwZPvzTvsqUsBhtky3K7r7VirqYTlo077Fgv FWBFjc075yWyVL6t83NA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gEQNU-0002rh-AQ; Mon, 22 Oct 2018 02:55:36 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gEQNR-0002qI-Hq for linux-mediatek@lists.infradead.org; Mon, 22 Oct 2018 02:55:35 +0000 Received: by mail-pg1-x544.google.com with SMTP id r190-v6so6686424pgr.13 for ; Sun, 21 Oct 2018 19:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qvvQuWaM77+h+B5Lh9KQjmG8HZmpb66a3ZGfQIMlXEw=; b=diSEKb0hhifWrMi4CU+slZuT7sRXokJZHd9tlouD4SU6oeK6k/B1GJUCyOyD6V8Xbv CLElmmZjkpTDp4aI1lc8Xime3zLdU1nwNrwHmaVXI+Q0RxyCNuHN68wanUO4mB212hSq a4hodd+xMNr9tqsUJMcarQC/zy2cSK/e+Quww= 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=qvvQuWaM77+h+B5Lh9KQjmG8HZmpb66a3ZGfQIMlXEw=; b=tMCuDOlpTP0Uzgwp73iACB3fBK2mTVCtXym+odHf53X/L7uAK1+G0k1IuyrIavZNw/ 47rtSxqRJciN4GDABrWtu1Z0foXmNr2elMFCIiPx4hFKj8QLl1BKZJ6t8APskqT4wYjW gIuWd0a8S0VAHheqgPSQlfl9Fez2Dfr6wCa2oq6RCZ65CVyW+dZ4UJqXzciHunLL5G+S YTs5tysN/6iilBPwRfV/C6rG8mzdpJXD0Ddih9mio2wBy2CTNIaYJ16SKFBlvRmJVhKG 98ekHmVuGlNPv+GJ0DQjM3AfXx2OhbTF6zNWt/lCVnku6j0uZG/vfR0w0sxubUEMnBB3 VV7w== X-Gm-Message-State: ABuFfoiY3qw2rPouc4jJmbcLsf7F5ULFdusMLL9g+K64e8CMjbgw4Tf6 geMwIS8OIg95Q5zD4N5v6BJqVQ== X-Google-Smtp-Source: ACcGV63GpG1FnJL8W5PugG2KA/X8LpinRmDB76F2qOGIaHPmjQS3a6BkM6BHfIhsJc4L/8Q8M6kTiA== X-Received: by 2002:a63:e04d:: with SMTP id n13-v6mr22324061pgj.426.1540176919834; Sun, 21 Oct 2018 19:55:19 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:f659:7f17:ea11:4e8e]) by smtp.gmail.com with ESMTPSA id y144-v6sm44116622pfb.81.2018.10.21.19.55.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Oct 2018 19:55:18 -0700 (PDT) From: Nicolas Boichat To: "Lee Jones )" Subject: [PATCH] mfd: mt6397: Do not call irq_domain_remove if PMIC unsupported Date: Mon, 22 Oct 2018 10:55:06 +0800 Message-Id: <20181022025505.27919-1-drinkcat@chromium.org> X-Mailer: git-send-email 2.19.1.568.g152ad8e336-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181021_195533_606962_77973BD1 X-CRM114-Status: GOOD ( 11.60 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If the PMIC ID is unknown, the current code would call irq_domain_remove and panic, as pmic->irq_domain is only initialized by mt6397_irq_init. Return immediately with an error, if the chip ID is unsupported. Signed-off-by: Nicolas Boichat --- drivers/mfd/mt6397-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 77b64bd64df36a..ab24e176ef4487 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -329,8 +329,7 @@ static int mt6397_probe(struct platform_device *pdev) default: dev_err(&pdev->dev, "unsupported chip: %d\n", id); - ret = -ENODEV; - break; + return -ENODEV; } if (ret) {