Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4914012imc; Mon, 25 Feb 2019 13:31:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IYyDdoWRq7Ryle4cMLqlrreONW2WfMsEcKznjBVed/S9d6fyCeRXu7ZO+R1a6gNnFUOOVQI X-Received: by 2002:a65:490e:: with SMTP id p14mr20834606pgs.373.1551130290749; Mon, 25 Feb 2019 13:31:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551130290; cv=none; d=google.com; s=arc-20160816; b=LXbarxU5hlO5JAyTj3c4xvgPQOG4n/eeyHLaZViWHLBiPfqy7S9/520Dsk1xW9NAXh GybIqGj3q4pBIBURX9Louizy4zV2YrlfpXL74ljvqdXKnxlPP8BQtldMSm8/nqSLloR8 ijHDfxOIQ1UgpSq2xfZg+xpCMp6g+Y388v0uPXSR2cGEJ7e0c8q0ECuJDaEKgMnTKNA+ geXIy+8uAPS0QuIEBB07hT833aD5Fz5A6DWN3HeW7iywzpo51yzNP00CPMVnbY6YC34G NzcUvPsCqkJDR+pACAJzioTIFCGqM5aO/q6O+NuBNCpYfSUTowD1UcmkVK5H780ei4/b FGHA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=t4AOhtbz+tulZLNWF9mRPu4P/lQ96RyvGoEhKYPrHjo=; b=hy4HBwbwaevBjflURkGn3jVq1x4xMD0CPMdjJgYtHx25cjSUm5QSCGW8G9+su00Xzb iZr5BsZxUz0w5MSkGtXyXnSldHMM9LrZEW4RU1fiOGBo+wQ80GpATZDnpRZrGEDClgsn T6lwFXxEETPjblNsOzkoyXzOnqEvLWzn7rh/plLC+dnYp5uHCjtsP4f4adK8/sftVHiX ML3au8BDkx1eXs1FP5KroOcrfsMyqwG9ozWTdZOT+3vgquuSYFL9h1teDgptg9II2lHA sg7CukWC0y/66OU2N8jxb9ezSquA+2JBUsy195OAlKrQ4SVUz38Ahsef2fmx/oz7XjF+ DhRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rPeFEQSf; 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 bg3si10739499plb.363.2019.02.25.13.31.15; Mon, 25 Feb 2019 13:31:30 -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; dkim=pass header.i=@kernel.org header.s=default header.b=rPeFEQSf; 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 S1732027AbfBYV3i (ORCPT + 99 others); Mon, 25 Feb 2019 16:29:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:35304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732013AbfBYV3e (ORCPT ); Mon, 25 Feb 2019 16:29:34 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 66BB42146F; Mon, 25 Feb 2019 21:29:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551130173; bh=3gJvfJL8CDGoZe+b5FpF4hpvDaGsOFdcwQDYu1zHCu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rPeFEQSfo8xuBUzS0BzpqtN+VGka7uBLSj5E6+rmLryRLLtCcBZ+TbtoKcbMi/CRZ xVMacIuAy0q7imvcup1vPyHNCOLMWSab8KRUBQBnFz4hO1VocbhTie5WQm9twVLYCB eV9IoWc9AFVa5fzR8UazbTC+B/u9Adsc1QQGpBIo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Hohnstaedt , Keerthy , Sebastian Reichel , Lee Jones , Sasha Levin Subject: [PATCH 4.20 037/183] mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe() Date: Mon, 25 Feb 2019 22:10:10 +0100 Message-Id: <20190225195100.935092939@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190225195054.748060397@linuxfoundation.org> References: <20190225195054.748060397@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 75d4c5e03c2ae9902ab521024b10291f6fc9515b ] Use devm_regmap_add_irq_chip and clean up error path in probe and also the remove function. Reported-by: Christian Hohnstaedt Signed-off-by: Keerthy Reviewed-by: Sebastian Reichel Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/tps65218.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c index 910f569ff77c1..8bcdecf494d05 100644 --- a/drivers/mfd/tps65218.c +++ b/drivers/mfd/tps65218.c @@ -235,9 +235,9 @@ static int tps65218_probe(struct i2c_client *client, mutex_init(&tps->tps_lock); - ret = regmap_add_irq_chip(tps->regmap, tps->irq, - IRQF_ONESHOT, 0, &tps65218_irq_chip, - &tps->irq_data); + ret = devm_regmap_add_irq_chip(&client->dev, tps->regmap, tps->irq, + IRQF_ONESHOT, 0, &tps65218_irq_chip, + &tps->irq_data); if (ret < 0) return ret; @@ -253,26 +253,9 @@ static int tps65218_probe(struct i2c_client *client, ARRAY_SIZE(tps65218_cells), NULL, 0, regmap_irq_get_domain(tps->irq_data)); - if (ret < 0) - goto err_irq; - - return 0; - -err_irq: - regmap_del_irq_chip(tps->irq, tps->irq_data); - return ret; } -static int tps65218_remove(struct i2c_client *client) -{ - struct tps65218 *tps = i2c_get_clientdata(client); - - regmap_del_irq_chip(tps->irq, tps->irq_data); - - return 0; -} - static const struct i2c_device_id tps65218_id_table[] = { { "tps65218", TPS65218 }, { }, @@ -285,7 +268,6 @@ static struct i2c_driver tps65218_driver = { .of_match_table = of_tps65218_match_table, }, .probe = tps65218_probe, - .remove = tps65218_remove, .id_table = tps65218_id_table, }; -- 2.19.1