Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1748118ima; Sun, 21 Oct 2018 20:04:49 -0700 (PDT) X-Google-Smtp-Source: AJdET5cxSC89/R2cpZqRtIpBT/jGerkxEo6apdpAcWr3A7U0zpeUlENghDfoh/lkHyMRJ1t1aEgC X-Received: by 2002:a17:902:bf02:: with SMTP id bi2-v6mr4743685plb.186.1540177489651; Sun, 21 Oct 2018 20:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540177489; cv=none; d=google.com; s=arc-20160816; b=oQ8V2r0x1MP8hBt3DhsqgvaDxiUD0aOjC5Dvac/9h17dlLlUBvYsG/YLgRT/4k8NKV hk8ZwYKZrxmf+BmbH+kNWZ3OBE2161hzglGyBF1rNHHtQwzQDpkgsbI8Tv0BSeLBHKuQ XVlaaApXTu41KXCYx2DP6CUmAokPy8Cqn7APPrSZpxVTBmaNMq8QcrftZtqVXf3j6zWv Ob+O/lYcdL/s4DyLwX80tl5n/JBKoMIJm6rjYKEfdRO2CQQZVPndHM1XJ6HyIz0iipos talMonXRxIRw4/A71QybCTZcAig50PUTOP+e9UQmZq0SzMqDnQQD37Jdhy2Fm1uXHz4Y tBMg== 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=qvvQuWaM77+h+B5Lh9KQjmG8HZmpb66a3ZGfQIMlXEw=; b=wcq/3RhmvjgTE7oFciIrqGkgFC8ty4IMm6UkONl2YMuNEnYcsKj+9fPWcGU/BPf5GF M97LotlhFLW7gHU5uVXpaHzAGNxKqxPwM4aiz2RV55MHyX7kdz8dT2wB5N8QXDEPWM2r 4wFVMlk2DJ7d+Rq1xfd3OnYLX8U1ByKzFzds5oaJ5Lm9d/BXAoAkmqXIpFfPfZ3ff8HI mLdhBs6lcf6sK62UARqRhsUhhqXcucHtFtraxrFNR4ux3pXkNDPYu2rPKbPS1MCj9Ml8 W/iJZFgUcVQU2Yz/Nxn2K0duV7slfAvmONWkZbK+3QbphXVlUp+gSX21tZI5T4g/Qt4e Y1bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=diSEKb0h; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16-v6si10821228pgg.245.2018.10.21.20.04.34; Sun, 21 Oct 2018 20:04:49 -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=@chromium.org header.s=google header.b=diSEKb0h; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727144AbeJVLLz (ORCPT + 99 others); Mon, 22 Oct 2018 07:11:55 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:32858 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726857AbeJVLLz (ORCPT ); Mon, 22 Oct 2018 07:11:55 -0400 Received: by mail-pg1-f196.google.com with SMTP id z2-v6so1911082pgp.0 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=G2mBLq1gbu6FZzpHN66D27VvVV7m5h6eP8iXvkug83k+kVs7f7NGk0FW0QQqc+qSZB IgGRiXclWfg+udMnEMInmGTHjGqC3o+ESFVZqXibCtZGmp0Z4ASHqPne8sVqFqaa9o3J x55nyugkLA0dN8+Yu1sgWF0IpsGHCb4UOQoHbi9jORT/8DL1hAmRMgBH7+3LAX/IlCwQ gJf3QGpAsMy7DTp4GPNhF7hCZiajah7P5rgi/faNYu4TgZ48gd8XWHOvwQugQrFOdmmi sOWW2r2KiRpIy/XNhMeTsAMk1xEdQ5rsArNFsPjfQ3AZIhs55tp66cRbki/6GWqykVax oIaw== X-Gm-Message-State: ABuFfoig1Wmi0XNsO/Ma1DCTS3YF/BD3ie0NNrisRmoCv1t1aJUPFaYl f1wBwlcrAIA7z9yqd5vA7EY6b8lccm4mkw== 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 )" Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) { -- 2.19.1.568.g152ad8e336-goog