From patchwork Tue Jan 8 06:48:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13904 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 371EB23ED1 for ; Tue, 8 Jan 2013 06:56:44 +0000 (UTC) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by fiordland.canonical.com (Postfix) with ESMTP id 9F5BCA18D54 for ; Tue, 8 Jan 2013 06:56:43 +0000 (UTC) Received: by mail-vb0-f41.google.com with SMTP id l22so61510vbn.14 for ; Mon, 07 Jan 2013 22:56:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=qG+F4fGoW7bIgP7Z9oE9b+AN8PmL6WxCM66o2t5+A2w=; b=m/t+vNdHp5++qMV/j88rHYMPGiu2bTPSJL31Fb7HEJHhFtYJCC4Q54WxG72tMAUj1n q9gm60eRFFVbv6yxdUV3BjHH85F8JHiLmRAWKJu9JWxDu/+WlXWpImC/lkbi49JYeiEP M0AiC831HQayhRqLgeaSLpNPL7B6UCUugQfqxJAw+GyJHwEFACIa4guFXGTTaY2EWLUv DLWdLNVvd8f/CSDe7EPKzOqOFviFu0nGBp8zKD9vTjbOupQ6ZwtfkOax/ycfpQ0FMSp7 Z3vl+efQ4JfnZf+MzudAC9fZzXHq/+H/N+vL2GPJ6N/MvUea3jYOGyKDBAyNPRXC0nK3 RS3Q== X-Received: by 10.52.70.205 with SMTP id o13mr74642621vdu.75.1357628203008; Mon, 07 Jan 2013 22:56:43 -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.58.145.101 with SMTP id st5csp96877veb; Mon, 7 Jan 2013 22:56:42 -0800 (PST) X-Received: by 10.68.235.2 with SMTP id ui2mr194565317pbc.163.1357628200048; Mon, 07 Jan 2013 22:56:40 -0800 (PST) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx.google.com with ESMTPS id vy7si61621322pbc.216.2013.01.07.22.56.39 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 22:56:40 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.54 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.54; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.54 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-da0-f54.google.com with SMTP id n2so46499dad.13 for ; Mon, 07 Jan 2013 22:56:39 -0800 (PST) X-Received: by 10.69.0.74 with SMTP id aw10mr194833375pbd.87.1357628199554; Mon, 07 Jan 2013 22:56:39 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id oi2sm39088824pbb.62.2013.01.07.22.56.36 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 22:56:38 -0800 (PST) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] [media] s5k6aa: Use devm_regulator_bulk_get API Date: Tue, 8 Jan 2013 12:18:24 +0530 Message-Id: <1357627704-14269-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnlNNPz2uA6DsR38lkNB3MTbAtKMe3nzSULNgxM/u2ti/w5xxeZZZJYdFkPBgVhhLkolcn4 devm_regulator_bulk_get is device managed and saves some cleanup and exit code. Signed-off-by: Sachin Kamat --- drivers/media/i2c/s5k6aa.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/s5k6aa.c b/drivers/media/i2c/s5k6aa.c index 57cd4fa..bdf5e3d 100644 --- a/drivers/media/i2c/s5k6aa.c +++ b/drivers/media/i2c/s5k6aa.c @@ -1598,7 +1598,7 @@ static int s5k6aa_probe(struct i2c_client *client, for (i = 0; i < S5K6AA_NUM_SUPPLIES; i++) s5k6aa->supplies[i].supply = s5k6aa_supply_names[i]; - ret = regulator_bulk_get(&client->dev, S5K6AA_NUM_SUPPLIES, + ret = devm_regulator_bulk_get(&client->dev, S5K6AA_NUM_SUPPLIES, s5k6aa->supplies); if (ret) { dev_err(&client->dev, "Failed to get regulators\n"); @@ -1607,7 +1607,7 @@ static int s5k6aa_probe(struct i2c_client *client, ret = s5k6aa_initialize_ctrls(s5k6aa); if (ret) - goto out_err4; + goto out_err3; s5k6aa_presets_data_init(s5k6aa); @@ -1618,8 +1618,6 @@ static int s5k6aa_probe(struct i2c_client *client, return 0; -out_err4: - regulator_bulk_free(S5K6AA_NUM_SUPPLIES, s5k6aa->supplies); out_err3: s5k6aa_free_gpios(s5k6aa); out_err2: @@ -1635,7 +1633,6 @@ static int s5k6aa_remove(struct i2c_client *client) v4l2_device_unregister_subdev(sd); v4l2_ctrl_handler_free(sd->ctrl_handler); media_entity_cleanup(&sd->entity); - regulator_bulk_free(S5K6AA_NUM_SUPPLIES, s5k6aa->supplies); s5k6aa_free_gpios(s5k6aa); return 0;