From patchwork Fri Jul 27 07:08:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 10293 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 2AFD423E56 for ; Fri, 27 Jul 2012 07:09:49 +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 EFDB5A190EA for ; Fri, 27 Jul 2012 07:09:48 +0000 (UTC) Received: by ghbz12 with SMTP id z12so2859785ghb.11 for ; Fri, 27 Jul 2012 00:09:48 -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=V5ED9LSVetd94yc6F6TXQ9017IQ6m41R92azQ5jKhWQ=; b=aiA+qLWssENEGzjtMmyYLiMcEGKRnvcMbfngtjndxTHCh15mg/P+MSqCuAe/ZYB8h2 LCmSx/jMf34fb4hLRq9YIctO4h4SSzGt313RQNrDgYVV+ZYKNxcQeL1zbgzvGScZ3fla 4v8+/agTgCs/+RRT4PqyuuBs96xN1DNTeQOIAbWYmjaCe5f1pHcNF96fH9NSIEgqC955 ug2KsW/eWoIPy6HKdZL70JDh8rHqBFUcMWPbI8gPiI4yCChrpKjJFE4vNhbo+RNOwp63 0LqTYOAKXnqNP38fDO9QQtRPgFQjC7LZX9rlInegQapaTzDjQFKJRomoHIiR3w8l0SvG 8Ybg== Received: by 10.50.159.135 with SMTP id xc7mr3718539igb.1.1343372988346; Fri, 27 Jul 2012 00:09:48 -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 bs3csp14899icc; Fri, 27 Jul 2012 00:09:47 -0700 (PDT) Received: by 10.68.218.163 with SMTP id ph3mr11625898pbc.58.1343372987738; Fri, 27 Jul 2012 00:09:47 -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 ob3si3195489pbb.21.2012.07.27.00.09.47 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jul 2012 00:09:47 -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 rr4so5197136pbb.37 for ; Fri, 27 Jul 2012 00:09:47 -0700 (PDT) Received: by 10.68.222.103 with SMTP id ql7mr11726102pbc.48.1343372987485; Fri, 27 Jul 2012 00:09:47 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id qc5sm1355861pbb.6.2012.07.27.00.09.44 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jul 2012 00:09:46 -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 03/11] Bluetooth: Use devm_kzalloc in bluecard_cs.c file Date: Fri, 27 Jul 2012 12:38:33 +0530 Message-Id: <1343372921-18780-4-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: ALoCoQn4KCrH/lmu0qDXzWIHjMp8k0UNk3KGuPxBIu2/MUAzmqcggnvRsRkVE2iICV8/u3ZMjmnJ devm_kzalloc() eliminates the need to free memory explicitly thereby saving some cleanup code. Signed-off-by: Sachin Kamat --- drivers/bluetooth/bluecard_cs.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index 66c3a67..0c0838d 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c @@ -849,7 +849,7 @@ static int bluecard_probe(struct pcmcia_device *link) bluecard_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; @@ -864,10 +864,7 @@ static int bluecard_probe(struct pcmcia_device *link) static void bluecard_detach(struct pcmcia_device *link) { - bluecard_info_t *info = link->priv; - bluecard_release(link); - kfree(info); }