Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8160783imu; Fri, 28 Dec 2018 11:47:31 -0800 (PST) X-Google-Smtp-Source: ALg8bN5F6dX55U3+pRN1jHhE2ygs6040Kdcfw1ksk8QOolWC5IXox7AB++Am2qt7338Y8siJrfFA X-Received: by 2002:a63:194f:: with SMTP id 15mr27715309pgz.192.1546026451529; Fri, 28 Dec 2018 11:47:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546026451; cv=none; d=google.com; s=arc-20160816; b=kSmfCcKu0+tnmHS3kn3cxYi3bTzwHV66jjTMeiaqWx4fK3g0FprWMH/eJ3QTz9Se2l Dw9whRaU0Cn2R0Wnxo6gaBpNOa7yFZ4we7UQC2OeLDamaBBOUbfrGdyI/gN8ASzYfUSm paOHiboA0ogObjNKR6FlRmXMaV7vZqY5bGpclhfx2oznlzUhIiocddG8rymueoF/8oRs 3r0wy6yZRcXbLLP9OOgOqYNC4HB6QkBB6QjUly737MeOStl8iystX8Y1nOiHMl2WNqrR WXyfJ3Cfip806KvIDxwaO2ah8uNcJ45IoX+HaFZzRxe/5LacY2L/AieoVA6ClfLv0ySu x/Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=VotSMPrsPZwVDcsZIkhJLhIQXnkYBJ7BK9MQujBo2cA=; b=Eiev7XayBAQGNDhBbH/JHZW3JIk1DIxlylJ47JN4VTuZHfGDxjN4R0XxdRqdaLOHFp qpZwX6xW+LqjIFh4dGn/pYkUUolPvYrS2qilpVhjA0pmVNF7mNpR9rXyh0agODzP5DJN PqPMPQBOqLhWCpMhKaAd4BUzbHWtuGPwCbjWzz5w3wz9ol3ZIhVzvEAPNxsSZWwD3I9L xj3tocfyl0NCjYfxGRr3JTU9f9RS3Jz2DqZAvSBfwR5M/LqCHIEOuC5YJPnvhzY6OdYx Mc0hSqh3+hZjtlwqpuwZg9HIZb9pfrM7LLWS9bYo1X1DTIXrSoVLygvcHtTgEjv2LN37 DkYw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z19si9025444pfc.95.2018.12.28.11.47.16; Fri, 28 Dec 2018 11:47:31 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731745AbeL1LYC (ORCPT + 99 others); Fri, 28 Dec 2018 06:24:02 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:60674 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729450AbeL1LYC (ORCPT ); Fri, 28 Dec 2018 06:24:02 -0500 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id wBSBNJIm014778; Fri, 28 Dec 2018 05:24:00 -0600 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail3.cirrus.com ([87.246.76.56]) by mx0b-001ae601.pphosted.com with ESMTP id 2phjjt6sm0-1; Fri, 28 Dec 2018 05:23:59 -0600 Received: from EX17.ad.cirrus.com (ex17.ad.cirrus.com [172.20.9.81]) by mail3.cirrus.com (Postfix) with ESMTP id 11B8E611C8AC; Fri, 28 Dec 2018 05:27:00 -0600 (CST) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.408.0; Fri, 28 Dec 2018 11:23:59 +0000 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id wBSBNw9f030399; Fri, 28 Dec 2018 11:23:58 GMT From: Charles Keepax To: CC: , Subject: [PATCH] regmap: irq: Make IRQ type support optional Date: Fri, 28 Dec 2018 11:23:58 +0000 Message-ID: <20181228112358.5914-1-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=665 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812280103 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently only gpio-max77620 is using the type support in regmap IRQ, but the implementation causes the irq_set_type operation to fail on all other regmap IRQ chips. Avoid these regressions by skipping the type handling on any chips that don't define a set of supported types. Fixes: 1c2928e3e321 ("regmap: regmap-irq/gpio-max77620: add level-irq support") Signed-off-by: Charles Keepax --- drivers/base/regmap/regmap-irq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c index 1bd1145ad8b5e..8c674f1ad0fc8 100644 --- a/drivers/base/regmap/regmap-irq.c +++ b/drivers/base/regmap/regmap-irq.c @@ -257,6 +257,9 @@ static int regmap_irq_set_type(struct irq_data *data, unsigned int type) int reg; const struct regmap_irq_type *t = &irq_data->type; + if (!t->types_supported) + return 0; + if ((t->types_supported & type) != type) return -ENOTSUPP; -- 2.11.0