From patchwork Fri Jul 27 07:08:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 10301 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 2E21D23E56 for ; Fri, 27 Jul 2012 07:10:14 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id EC77BA190C3 for ; Fri, 27 Jul 2012 07:10:13 +0000 (UTC) Received: by mail-gh0-f180.google.com with SMTP id z12so2859785ghb.11 for ; Fri, 27 Jul 2012 00:10:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=3XtmwU9RKCaT63MCgJ/8qd7xr1psMcslHTl4/lGxOeU=; b=iylSIJq8IWkTWy9/PwfEfLoSvcAaOwWlF3Sm4jBsX2aTlUJTK69fwgtoYN0/Uh58Og Iw6ZTOLeKRdI/OO2mXXJ4VmpIKCOD0Hqpvm/euWWV1y/BBftwyd2ACnbkO3hMlJ3TVJJ 09kKzd/JDHI03NIbfUE+I3mEXg0xEY9TvRmFVidq5ZZ7zww3zgISeP6n0HrN40ktL00o K0zzAaZ9OS/syCG8qCTVHd5Nq8syt2I0dRdVss6RwASNNyYev3DfenIDzSkTnEM2YrOD DDDXxAuRYWpxFy+vw1HypeC7vNSCXhsaxqKPq5AVM7Ld7DIBUdQ6VblbjFNUrXVE1X+r N7tA== Received: by 10.50.149.170 with SMTP id ub10mr1011591igb.38.1343373013592; Fri, 27 Jul 2012 00:10:13 -0700 (PDT) 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.43.93.3 with SMTP id bs3csp14928icc; Fri, 27 Jul 2012 00:10:13 -0700 (PDT) Received: by 10.66.79.195 with SMTP id l3mr3403117pax.33.1343373013019; Fri, 27 Jul 2012 00:10:13 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id ky6si3198050pbc.18.2012.07.27.00.10.12 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jul 2012 00:10:13 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 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-f50.google.com with SMTP id rr4so5196961pbb.37 for ; Fri, 27 Jul 2012 00:10:12 -0700 (PDT) Received: by 10.68.216.72 with SMTP id oo8mr11428644pbc.82.1343373012790; Fri, 27 Jul 2012 00:10:12 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id qc5sm1355861pbb.6.2012.07.27.00.10.09 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jul 2012 00:10:12 -0700 (PDT) From: Sachin Kamat To: linux-bluetooth@vger.kernel.org Cc: marcel@holtmann.org, gustavo@padovan.org, johan.hedberg@gmail.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 11/11] Bluetooth: Use devm_kzalloc in dtl1_cs.c file Date: Fri, 27 Jul 2012 12:38:41 +0530 Message-Id: <1343372921-18780-12-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1343372921-18780-1-git-send-email-sachin.kamat@linaro.org> References: <1343372921-18780-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQmNL7xUGRFS/aWUgYqykFB6qVTy4G3FD2cBVyWodHfs4T/Yh9281NtP/3pAZuEwHmu/4Xzp devm_kzalloc() eliminates the need to free memory explicitly thereby saving some cleanup code. Signed-off-by: Sachin Kamat --- drivers/bluetooth/dtl1_cs.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c index 97a7784..036cb36 100644 --- a/drivers/bluetooth/dtl1_cs.c +++ b/drivers/bluetooth/dtl1_cs.c @@ -550,7 +550,7 @@ static int dtl1_probe(struct pcmcia_device *link) dtl1_info_t *info; /* Create new info device */ - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM; @@ -569,7 +569,6 @@ static void dtl1_detach(struct pcmcia_device *link) dtl1_close(info); pcmcia_disable_device(link); - kfree(info); } static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data)