From patchwork Tue Oct 18 14:28:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 9382243 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7D05360839 for ; Tue, 18 Oct 2016 14:33:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E0CF28AFA for ; Tue, 18 Oct 2016 14:33:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 622BB28C47; Tue, 18 Oct 2016 14:33:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC47828AFA for ; Tue, 18 Oct 2016 14:33:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761679AbcJRO3D (ORCPT ); Tue, 18 Oct 2016 10:29:03 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:41855 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754129AbcJRO3B (ORCPT ); Tue, 18 Oct 2016 10:29:01 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 9D0DA61801; Tue, 18 Oct 2016 14:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1476800940; bh=xatXHy2tLDB2/pUV1HJUrA/ZjpO1A/0RE5CAP5fe6Qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vj/IY+fBc04ef/+6tWvRfwuGVaOEFNt6sA+iZ32IFm+YG9YT/c65I+9z5GMXs/hN9 +CiT0yxepKkzXpvBAVET41YIZvwfmj29/WwLNIFPdhyaKHq8wjqHKBivmp6GNz/czo nAe6Ke0KOPoJRMRm6UAe6ojRLRiPGcNcEJKCV5Ns= Received: from blr-ubuntu-41.ap.qualcomm.com (unknown [202.46.23.61]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: vivek.gautam@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2644861824; Tue, 18 Oct 2016 14:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1476800940; bh=xatXHy2tLDB2/pUV1HJUrA/ZjpO1A/0RE5CAP5fe6Qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vj/IY+fBc04ef/+6tWvRfwuGVaOEFNt6sA+iZ32IFm+YG9YT/c65I+9z5GMXs/hN9 +CiT0yxepKkzXpvBAVET41YIZvwfmj29/WwLNIFPdhyaKHq8wjqHKBivmp6GNz/czo nAe6Ke0KOPoJRMRm6UAe6ojRLRiPGcNcEJKCV5Ns= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 2644861824 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=vivek.gautam@codeaurora.org From: Vivek Gautam To: kishon@ti.com, jejb@linux.vnet.ibm.com, vinholikatti@gmail.com, martin.petersen@oracle.com, linux-kernel@vger.kernel.org Cc: subhashj@codeaurora.org, linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vivek Gautam Subject: [PATCH v2 03/10] phy: qcom-ufs: Use devm sibling of kstrdup for regulator names Date: Tue, 18 Oct 2016 19:58:10 +0530 Message-Id: <1476800897-19898-4-git-send-email-vivek.gautam@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476800897-19898-1-git-send-email-vivek.gautam@codeaurora.org> References: <1476800897-19898-1-git-send-email-vivek.gautam@codeaurora.org> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This helps us in avoiding any requirement for kfree() operation to be called exclusively over the allocated string pointer. Signed-off-by: Vivek Gautam Reviewed-by: Subhash Jadavani --- No change since v1. drivers/phy/phy-qcom-ufs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/phy/phy-qcom-ufs.c b/drivers/phy/phy-qcom-ufs.c index 805c91d..f639a7c 100644 --- a/drivers/phy/phy-qcom-ufs.c +++ b/drivers/phy/phy-qcom-ufs.c @@ -262,7 +262,7 @@ static int __ufs_qcom_phy_init_vreg(struct phy *phy, char prop_name[MAX_PROP_NAME]; - vreg->name = kstrdup(name, GFP_KERNEL); + vreg->name = devm_kstrdup(dev, name, GFP_KERNEL); if (!vreg->name) { err = -ENOMEM; goto out; @@ -650,9 +650,6 @@ int ufs_qcom_phy_remove(struct phy *generic_phy, { phy_power_off(generic_phy); - kfree(ufs_qcom_phy->vdda_pll.name); - kfree(ufs_qcom_phy->vdda_phy.name); - return 0; } EXPORT_SYMBOL_GPL(ufs_qcom_phy_remove);