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: 14376 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 1590D23E92 for ; Thu, 31 Jan 2013 04:22:00 +0000 (UTC) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by fiordland.canonical.com (Postfix) with ESMTP id BBBE9A183F1 for ; Thu, 31 Jan 2013 04:21:59 +0000 (UTC) Received: by mail-ve0-f171.google.com with SMTP id b10so1701539vea.2 for ; Wed, 30 Jan 2013 20:21:59 -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=QdngxdC96gCDXDJ1l85CqcnE+g4E/uaAWDNutSRMoC4=; b=O/HlXVEbWKHn3mxB1wmX0U8ZjkWLBEu228MBF7iAStmNKzyoPXrB8DFrgY+IUeKK+l DY90kNDNFiPz5fOlXGvS1Ocp2oBkW4UuwBM3+tdeX0rH03byXSNpOTd/v9+opDdj/XAn RXlgAPi0ATpMwfDTEKTWSbHs4Cnlt7G+qDwGXLE0R9rhJ19PALingYluhRctxJLnn+yC WRAzrj6PMVcS7y0IXCX2GJxcqLI0qB8/TE+N5nL5YdOoBYahDlHx2LLl6dD8Q1iBvaqd SGwoGHX0YDVLF/zgTURcoMaGW1LD9dedDMnZiCqWbkKexLkLj84tyigFmV/mewYBJXu0 aqtA== X-Received: by 10.220.219.77 with SMTP id ht13mr6836996vcb.66.1359606119245; Wed, 30 Jan 2013 20:21:59 -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.252.8 with SMTP id zo8csp44005vec; Wed, 30 Jan 2013 20:21:58 -0800 (PST) X-Received: by 10.68.204.135 with SMTP id ky7mr18933596pbc.24.1359606118277; Wed, 30 Jan 2013 20:21:58 -0800 (PST) Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com [209.85.160.53]) by mx.google.com with ESMTPS id c9si3852096pax.104.2013.01.30.20.21.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jan 2013 20:21:58 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.53 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.53; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.53 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-f53.google.com with SMTP id un1so1377321pbc.40 for ; Wed, 30 Jan 2013 20:21:57 -0800 (PST) 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: ALoCoQk/gvXi5m/b58afDscCtIfD281ts6HoYL9VObYFAChMk3GG4LkV+s8LESQOJs9AlnWQFAj4 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;