From patchwork Thu Jan 31 04:12:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2070871 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 4D17F3FD1A for ; Thu, 31 Jan 2013 04:22:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756893Ab3AaEV6 (ORCPT ); Wed, 30 Jan 2013 23:21:58 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:33143 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756592Ab3AaEV6 (ORCPT ); Wed, 30 Jan 2013 23:21:58 -0500 Received: by mail-pa0-f47.google.com with SMTP id bj3so342910pad.20 for ; Wed, 30 Jan 2013 20:21:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=QdngxdC96gCDXDJ1l85CqcnE+g4E/uaAWDNutSRMoC4=; b=D2wj8ePlf8UoReg32CVZAxhDZGJyfumI7m0eLZlbqSIm+6cMiwBnakXIIrmtYu1q6u f2TQSKXM+fCb1cMbUgjZv8smtgSunLvFuteY9/DxrW5z3+Imm7oJKMAaVG43rYlOjfFq AHAvm/ptEP7E7RJwubyjBozttfXZGAyGSCQoQBM6cX7rd1mel0id8PASq8VXDeFEkz7H hCaNSpnvITmN3VwGO2BGDa4Dkf1OnqCarm3SsqqHg3esXCX5J36kMlyiUdSHq39FHdI3 HPNqQItZb3Mb8t+yYQF1OzhIV+vERsFe7uyN7alO4Be48PPO3OgqsRIb/+JZLclu+Iu3 1ReA== X-Received: by 10.66.87.67 with SMTP id v3mr17066314paz.63.1359606117793; Wed, 30 Jan 2013 20:21:57 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id sb3sm3648630pbc.44.2013.01.30.20.21.54 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 30 Jan 2013 20:21:57 -0800 (PST) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org, Andrzej Hajda Subject: [PATCH 1/1] [media] s5c73m3: Use devm_regulator_bulk_get API Date: Thu, 31 Jan 2013 09:42:46 +0530 Message-Id: <1359605566-8196-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQmU3RsCLB7j3iKE5n5zMQgwZq50GNSveDT+ABMKmsPhqJ5lnonGbhT7beJGKGFH9JVv3lam Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org devm_regulator_bulk_get saves some cleanup and exit code. Cc: Andrzej Hajda Signed-off-by: Sachin Kamat --- drivers/media/i2c/s5c73m3/s5c73m3-core.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c index b063b4d..c143c9e 100644 --- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c +++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c @@ -1627,7 +1627,7 @@ static int __devinit s5c73m3_probe(struct i2c_client *client, for (i = 0; i < S5C73M3_MAX_SUPPLIES; i++) state->supplies[i].supply = s5c73m3_supply_names[i]; - ret = regulator_bulk_get(dev, S5C73M3_MAX_SUPPLIES, + ret = devm_regulator_bulk_get(dev, S5C73M3_MAX_SUPPLIES, state->supplies); if (ret) { dev_err(dev, "failed to get regulators\n"); @@ -1636,7 +1636,7 @@ static int __devinit s5c73m3_probe(struct i2c_client *client, ret = s5c73m3_init_controls(state); if (ret) - goto out_err3; + goto out_err2; state->sensor_pix_size[RES_ISP] = &s5c73m3_isp_resolutions[1]; state->sensor_pix_size[RES_JPEG] = &s5c73m3_jpeg_resolutions[1]; @@ -1652,15 +1652,13 @@ static int __devinit s5c73m3_probe(struct i2c_client *client, ret = s5c73m3_register_spi_driver(state); if (ret < 0) - goto out_err3; + goto out_err2; state->i2c_client = client; v4l2_info(sd, "%s: completed succesfully\n", __func__); return 0; -out_err3: - regulator_bulk_free(S5C73M3_MAX_SUPPLIES, state->supplies); out_err2: s5c73m3_free_gpios(state); out_err1: @@ -1679,7 +1677,6 @@ static int __devexit s5c73m3_remove(struct i2c_client *client) media_entity_cleanup(&sd->entity); s5c73m3_unregister_spi_driver(state); - regulator_bulk_free(S5C73M3_MAX_SUPPLIES, state->supplies); s5c73m3_free_gpios(state); return 0;