From patchwork Tue Jan 8 08:57:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13907 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 F390723ED1 for ; Tue, 8 Jan 2013 09:05:14 +0000 (UTC) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by fiordland.canonical.com (Postfix) with ESMTP id 9BA98A18DBB for ; Tue, 8 Jan 2013 09:05:14 +0000 (UTC) Received: by mail-vb0-f43.google.com with SMTP id fs19so142372vbb.30 for ; Tue, 08 Jan 2013 01:05:14 -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=4wYMLXkqh3DoyzJ/l2xHp7qQR8g2YPvzsnb1JiDucZA=; b=YSYedwu8XjIbdEHR2qD977au7xAxr9MZeN4/T00Hpmb6sGceRQwR/x3m34VcAI5Dqv SSA5I1qXIq5LbVS8g7ujUfxh+OgVLxl5J3vcu+yEEqoW+8ruOeiIgIuKy3oRGZIMpZ6c 9NBq1tsMGhd0CXz8CWQ+cwlHdQBJS7v/aiWijzoJu3KCJfEPX4u4VYwxXQYzdQ6tSjUI YQq4cWKpxYg4hOpG1lN1mrtQVyjoaKNJ1xA0TTQe1WjWDy6vPjTzemC6/RUtPcKLjlnL Uw9/Q8swF82+/8QtrgF5HzFYtPjXZ8y0JtP5QG8oUliyPHJZBm5hik9E7x7UYkNot4j0 qAHw== X-Received: by 10.52.176.6 with SMTP id ce6mr74877329vdc.57.1357635914109; Tue, 08 Jan 2013 01:05:14 -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 st5csp100402veb; Tue, 8 Jan 2013 01:05:13 -0800 (PST) X-Received: by 10.68.243.33 with SMTP id wv1mr191566760pbc.143.1357635912678; Tue, 08 Jan 2013 01:05:12 -0800 (PST) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx.google.com with ESMTPS id h8si62292122pay.250.2013.01.08.01.05.12 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2013 01:05:12 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.47 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.47; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.47 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-pa0-f47.google.com with SMTP id fa10so212378pad.6 for ; Tue, 08 Jan 2013 01:05:12 -0800 (PST) X-Received: by 10.68.251.136 with SMTP id zk8mr194166606pbc.82.1357635911861; Tue, 08 Jan 2013 01:05:11 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id kb3sm39290562pbc.27.2013.01.08.01.05.08 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2013 01:05:11 -0800 (PST) From: Sachin Kamat To: linux-usb@vger.kernel.org Cc: balbi@ti.com, gregkh@linuxfoundation.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] usb: gadget: s3c-hsotg: Use devm_regulator_bulk_get API Date: Tue, 8 Jan 2013 14:27:00 +0530 Message-Id: <1357635420-20458-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQlwFNExHR4Nw5po+bHhLX1hxCDGjAHGhkyerzExkIfT5PgyenL1WhcHyrVo4M0mm3Tec7oS devm_regulator_bulk_get is device managed and saves some cleanup and exit code. Signed-off-by: Sachin Kamat --- drivers/usb/gadget/s3c-hsotg.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 439c3f9..4485690 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c @@ -3572,7 +3572,7 @@ static int s3c_hsotg_probe(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(hsotg->supplies); i++) hsotg->supplies[i].supply = s3c_hsotg_supply_names[i]; - ret = regulator_bulk_get(dev, ARRAY_SIZE(hsotg->supplies), + ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(hsotg->supplies), hsotg->supplies); if (ret) { dev_err(dev, "failed to request supplies: %d\n", ret); @@ -3662,8 +3662,6 @@ err_ep_mem: kfree(eps); err_supplies: s3c_hsotg_phy_disable(hsotg); - regulator_bulk_free(ARRAY_SIZE(hsotg->supplies), hsotg->supplies); - err_clk: clk_disable_unprepare(hsotg->clk); @@ -3688,7 +3686,6 @@ static int s3c_hsotg_remove(struct platform_device *pdev) } s3c_hsotg_phy_disable(hsotg); - regulator_bulk_free(ARRAY_SIZE(hsotg->supplies), hsotg->supplies); clk_disable_unprepare(hsotg->clk);