Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1590027imm; Thu, 12 Jul 2018 04:42:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfJS84P7iAch74tvEbEeuajYGi+zZrSeYegL63sLAjEzTnYERGzFML0IBp0vMi7h50+iQjP X-Received: by 2002:a62:cd44:: with SMTP id o65-v6mr2024728pfg.47.1531395762705; Thu, 12 Jul 2018 04:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531395762; cv=none; d=google.com; s=arc-20160816; b=HVXF1AnGDvu0qCJwpqDTb3C4K5Sjvf2o+9waM/MyN07gY+j0B8fdoAgY+6YqgurRmW Mwo1NLaVag4+crsgyMxRMNNthyE7WXlZQPiTaCwTO7LSchSwAHMTu/XRT68QlmtfkEei SsBskbAtXCwNKZ8OkNV8VxcM+kSbdLw1DRl4AFLY7csAMN8IbLs1C8nP/IifXEc2XXKi ASwNcy3Q7E6HEfXIiGyj9rXZpibyv9dUkNM26koqgMBcnTlotN3Yi55IbWp1sCDmWt2y ynedJyQ4SZY4NdbWQ2UkVUGcH5Fkb1a9PmV5fkrRC8Cjw1ABc1aNUgeUy1JN/eeqm58Y 1Yqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Xn9xNUhenQ6ZYCCl4OkzAbhxSqvo1aWlc0y05rj5By8=; b=T8D6vWIDMBuKF+QdQHMr032pBRNgfsYPxcOg15CKUqD75d2y+X05jKIadTGyXhXFxf aL8nZKMbmTKB7weV2Poejd7eAd94q0WpPTSCQz605GHD9wTzAfWQ977mT2pIze4ZwJAT IcgMarjH6VXoSzxVkfIK9YLVmXhX6bPHbpm3m6xZOONd37oku3HggH9JDSXKOqHachPp iXp7FaK4VCcwoBLgWHaC/ylymNDzxFAr1wPKH6urUxq+cYsFtHLwv/t9MK+jK9XlVmIi neZ2+acvI/rkc0KMH2o/Sa250ijN/yb+fxZXdK1ImpPMB5OOJNF88tW4WlfMRChPd7Kl 9WFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="eUX5nL/C"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j66-v6si21944966pfc.243.2018.07.12.04.42.25; Thu, 12 Jul 2018 04:42:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="eUX5nL/C"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726961AbeGLLu4 (ORCPT + 99 others); Thu, 12 Jul 2018 07:50:56 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36465 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726778AbeGLLuz (ORCPT ); Thu, 12 Jul 2018 07:50:55 -0400 Received: by mail-wr1-f66.google.com with SMTP id h9-v6so21383324wro.3 for ; Thu, 12 Jul 2018 04:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Xn9xNUhenQ6ZYCCl4OkzAbhxSqvo1aWlc0y05rj5By8=; b=eUX5nL/CoRLYkz4K1tAwINR9ua47OhGa/Z0wDiBcmZeXM+Qxn8lgFP/huWgE/mzltD FpHcIwDy8AnSG9GAR1rSE55WnMqAOP6wakcwAxfCrELQwAhdF7QUUL8KDZvk2Ald47wH HcKCKM9FTTsbsPYZBrmS2IOLWW407+kvLJ2z5Utw0R2EY2QGgM8auVmOl50jj+NftnPp pDmc77OSY+RF448QnoaBKNfeOKc2r6oBHHR/nRfofXd2QCLLh5F3anGGaoyU26OhtKLr mEVvFwbQUa2fWO2+nH1RCiq3h8u6J9gHGAr4kvSgf3c4PAcRSHmuo3GyM+0Q1iF+2fjf xtIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Xn9xNUhenQ6ZYCCl4OkzAbhxSqvo1aWlc0y05rj5By8=; b=pQWjHTCXz/hAtHfOJCy925sBmN/hmGNdU9qu3fn5QUwzFL2Hc8HoSDcaqFMlGbAoJY h74IbHkY+KkKQIAx2BpAkgshE4XMjxLyMPacDp0dbtVqaaudvHvjHiwoc0fyuDKBAznx Cxnudk7vSw4dtTJ+p3536c8U4H2jG8vrb/0Yv3j7tGlDFeMtdXZquZIF4ruWv3cXY214 3zkKGOuF9OW3+t8HbX1TnSle9G7wK8AHmZ2NqkPT/oUAAzYgbaW2oKe7scZIEymSTJOj Dh8GEZq8lGbE/ReryfDh28SQwS3LURjoWTyZfbK45Av1I0SmLNKNw9l8BKwm743Y6PJc n1Og== X-Gm-Message-State: AOUpUlFah1RvYH8Ws+PaFg+EKhCMzcOkW6MG5IJiYfF8abFrz/PIg+oD EdgWtbjAVp/ITG/zzvpvQWhKuVBf X-Received: by 2002:adf:9d81:: with SMTP id p1-v6mr1571862wre.12.1531395704466; Thu, 12 Jul 2018 04:41:44 -0700 (PDT) Received: from localhost.localdomain ([51.15.160.169]) by smtp.googlemail.com with ESMTPSA id l3-v6sm7716939wrb.34.2018.07.12.04.41.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Jul 2018 04:41:43 -0700 (PDT) From: Corentin Labbe To: hdegoede@redhat.com, tj@kernel.org Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH 3/3] ata: ahci_platform: convert kcalloc to devm_kcalloc Date: Thu, 12 Jul 2018 11:41:31 +0000 Message-Id: <1531395691-4653-4-git-send-email-clabbe@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531395691-4653-1-git-send-email-clabbe@baylibre.com> References: <1531395691-4653-1-git-send-email-clabbe@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Like phys, target_pwrs could be allocated with devm_ function Signed-off-by: Corentin Labbe --- drivers/ata/libahci_platform.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c index be9f54423a9b..fe8939e161ea 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -271,8 +271,6 @@ static void ahci_platform_put_resources(struct device *dev, void *res) for (c = 0; c < hpriv->nports; c++) if (hpriv->target_pwrs && hpriv->target_pwrs[c]) regulator_put(hpriv->target_pwrs[c]); - - kfree(hpriv->target_pwrs); } static int ahci_platform_get_phy(struct ahci_host_priv *hpriv, u32 port, @@ -408,7 +406,7 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev) rc = -ENOMEM; goto err_out; } - hpriv->target_pwrs = kcalloc(hpriv->nports, sizeof(*hpriv->target_pwrs), GFP_KERNEL); + hpriv->target_pwrs = devm_kcalloc(dev, hpriv->nports, sizeof(*hpriv->target_pwrs), GFP_KERNEL); if (!hpriv->target_pwrs) { rc = -ENOMEM; goto err_out; -- 2.16.4