Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp104490imu; Thu, 6 Dec 2018 16:50:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/V52nAHQsFXvI9gpgww8wiyGvP1w3XT1Mq7m1cXKQdhW5bpshOxsB9H46/OU734bO8VKBWo X-Received: by 2002:a63:a452:: with SMTP id c18mr135938pgp.204.1544143858275; Thu, 06 Dec 2018 16:50:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544143858; cv=none; d=google.com; s=arc-20160816; b=pfI4BSwp2qYtY4RtKerxaHZL6Z1fTssNu+f25WBTEAgvk83bCvfQfOxVtyXKspamnN kKi7p+5Xx1FdKupmpr8B0Kx9WO4qpxASeCF8jNZ/JuQ0rQL2GyGyXl4y07y9OnDckPAX 3t3oAkmIk7BmFqI6cFSpz6OrQhhCOIgAmOZF6zegM6kUJTXeXESVOqQe6F1+fu4xuMQI /iDERDxaXtLdze3eJtpBIhb4UMp0JhkkXZaDUe375qonPCjFvpR1clDBqDCw1FRJ8eRd 9pNm+1kCTeV3FuYdK4teQXPwvbnCaWMDedl2LltivVJ+h039ZKJMTlHllsSOn5ISBoH6 sTeg== 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=2CwmjW7ApWmGtncv8F4Mb/cS7ZH5PrPUP70ChP78aUo=; b=T8Cea4O65xKLsdqgButekNN6O+uMqpHdMv5gvkErLRsTzUCO/UYGk8qjD79GQN38IE uyXTcmW0Fnhov/n+A9Ze1VE5QHnK/UXEv4IOig3SQdKw5Ug+dFlwDLkm8D2aGFXFC6+K 7leQfwrC1qh8Fc3y1Im4sOIfeHIab6clzHJUP7m7M3kSa6mUwgoCDJtP0RG68pAu0zXs 7Eo2YVrh99AdLatZbuleXak1LcaCMzAPsukyC1vGzEBtCLG356vmuaHSz8bro+g4ZzKL BH04STigfrpuUaixOL1NxUTzOOWSUfo417gjRbJTVQF9kJp4yWJ033KliICJTJa9LHui nxZQ== 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v35si1519653pgl.130.2018.12.06.16.50.41; Thu, 06 Dec 2018 16:50:58 -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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725981AbeLGAuF (ORCPT + 99 others); Thu, 6 Dec 2018 19:50:05 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:60642 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725945AbeLGAuE (ORCPT ); Thu, 6 Dec 2018 19:50:04 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id wB70o0Bw003344; Thu, 6 Dec 2018 18:50:00 -0600 Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wB70o0RM043838 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Dec 2018 18:50:00 -0600 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Thu, 6 Dec 2018 18:50:00 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Thu, 6 Dec 2018 18:50:00 -0600 Received: from ula0393675.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id wB70nvnV000583; Thu, 6 Dec 2018 18:49:58 -0600 From: Keerthy To: , CC: , , , , , Subject: [PATCH v2] tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe Date: Fri, 7 Dec 2018 06:19:48 +0530 Message-ID: <1544143788-22606-1-git-send-email-j-keerthy@ti.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use devm_regmap_add_irq_chip and clean up error path in probe. Hence clean up the probe error path and the remove function. Reported-by: Christian Hohnstaedt Signed-off-by: Keerthy --- Changes in v2: * Cleaned up remove function as well. drivers/mfd/tps65218.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c index 910f569..d2d4e3a 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,23 +253,11 @@ 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; } -- 1.9.1