From patchwork Fri Dec 7 08:38:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13404 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A70DC23E1F for ; Fri, 7 Dec 2012 08:45:06 +0000 (UTC) Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com [209.85.223.170]) by fiordland.canonical.com (Postfix) with ESMTP id 1CDA9A18027 for ; Fri, 7 Dec 2012 08:45:06 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id k10so537781iea.29 for ; Fri, 07 Dec 2012 00:45:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=YySebAEUxFM1ONK9j3skpozWgxGKFHZj1AdRnLbgXPw=; b=ZumGLVr81ZjqU1gVSz3+4SRA+OMwGo78sYLsWn5En56Tkf5RBo6AgW++cAM2V7oHtv Mo1NdPjy2dOvZRREYRN9JOgziNB5ifR1lmmU63i9y2x/VvpUDfCFzpqaPUbijPGnf12i GpQ5RXZd2foQ0WnT11tbd/p0Qmw+h5YmHeJtR6DsQZyX8slPPUuROShMULAAI+kScqpE BW9VaTQm9kbuaOdUZSP/2xKVRWTMHA1pKhm5LrwfV5oVFeGomEkVNrj1Z3Ps/fTTyohk Hwr3vdYnMuj3pZDyL+bNwjgFu2StK3QwEat5DPayRHtLYde2m/h6Idm/+kQQz3T+Uk9v vAMg== Received: by 10.50.173.34 with SMTP id bh2mr4236354igc.70.1354869905562; Fri, 07 Dec 2012 00:45:05 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp461514igt; Fri, 7 Dec 2012 00:45:04 -0800 (PST) Received: by 10.68.223.131 with SMTP id qu3mr13759420pbc.89.1354869904021; Fri, 07 Dec 2012 00:45:04 -0800 (PST) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by mx.google.com with ESMTPS id wu8si15078395pbc.3.2012.12.07.00.45.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Dec 2012 00:45:04 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.51 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.51; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.51 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pb0-f51.google.com with SMTP id ro12so202745pbb.10 for ; Fri, 07 Dec 2012 00:45:03 -0800 (PST) Received: by 10.68.240.233 with SMTP id wd9mr13760453pbc.127.1354869903520; Fri, 07 Dec 2012 00:45:03 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id f2sm6234988paz.25.2012.12.07.00.45.00 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Dec 2012 00:45:02 -0800 (PST) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: sameo@linux.intel.com, sachin.kamat@linaro.org, patches@linaro.org, Qiao Zhou Subject: [PATCH 1/1] mfd: 88pm80x: Remove unnecessary exit APIs Date: Fri, 7 Dec 2012 14:08:09 +0530 Message-Id: <1354869489-4054-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQm8WQh7d9ch9ko0thlDv5ZWLD2rTxud3AzsrLRusWfSIfoHTLkpvKVHpWcLT+U4aEktHsF/ This driver uses devm_* APIs. Thus explicit exit calls (regmap_exit and devm_kfree) are not needed as they are device managed APIs. Cc: Qiao Zhou Signed-off-by: Sachin Kamat --- drivers/mfd/88pm80x.c | 19 +++---------------- 1 files changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/mfd/88pm80x.c b/drivers/mfd/88pm80x.c index 1adb355..3288a4a 100644 --- a/drivers/mfd/88pm80x.c +++ b/drivers/mfd/88pm80x.c @@ -48,14 +48,12 @@ int pm80x_init(struct i2c_client *client, ret = PTR_ERR(map); dev_err(&client->dev, "Failed to allocate register map: %d\n", ret); - goto err_regmap_init; + return ret; } chip->id = id->driver_data; - if (chip->id < CHIP_PM800 || chip->id > CHIP_PM805) { - ret = -EINVAL; - goto err_chip_id; - } + if (chip->id < CHIP_PM800 || chip->id > CHIP_PM805) + return -EINVAL; chip->client = client; chip->regmap = map; @@ -82,19 +80,11 @@ int pm80x_init(struct i2c_client *client, } return 0; - -err_chip_id: - regmap_exit(map); -err_regmap_init: - devm_kfree(&client->dev, chip); - return ret; } EXPORT_SYMBOL_GPL(pm80x_init); int pm80x_deinit(struct i2c_client *client) { - struct pm80x_chip *chip = i2c_get_clientdata(client); - /* * workaround: clear the dependency between pm800 and pm805. * would remove it after HW chip fixes the issue. @@ -104,9 +94,6 @@ int pm80x_deinit(struct i2c_client *client) else g_pm80x_chip = NULL; - regmap_exit(chip->regmap); - devm_kfree(&client->dev, chip); - return 0; } EXPORT_SYMBOL_GPL(pm80x_deinit);