From patchwork Fri Jul 27 07:08:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 10295 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 2493323E56 for ; Fri, 27 Jul 2012 07:09:55 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id E99BBA190C3 for ; Fri, 27 Jul 2012 07:09:54 +0000 (UTC) Received: by mail-yx0-f180.google.com with SMTP id q6so2855352yen.11 for ; Fri, 27 Jul 2012 00:09:54 -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=2bUIItNfeev8aaZaDFTSI5KiQwO4D4z+IQmtLpZA7Dk=; b=ApuKVmXbSiM0CrLK3zmTS5uK0anT/q7kbX7gj/zL1b9F9XwOBSf6XYbRXFx4lSxosw X/JbPcAU+lG3RrkiUxWoXRRDdkdJNDnmeOBVdhvQZwQgXoXtDjdWx/uOCcC6kMIYDafq Qzyx1e7mQaJNx0CL8YyHWdQqfC+cL/jwiV9R3jYXaMhd+pXcIoVWF+2XSCqS+ZIs13cJ 8LexK9eP6MkC9X5Id8Z3+J/uENBkFZRqdlkweIodCCVVtXbgZbj3E8UaH/0LZsGQeRI7 xkV/DDFp9DEfjEhjZXK8umd8vz23sREyrj49ux1lbLtohjDq8uSls5q8Z3UxVrGf9k4c 7Bng== Received: by 10.50.87.201 with SMTP id ba9mr3671060igb.66.1343372994565; Fri, 27 Jul 2012 00:09:54 -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 bs3csp14907icc; Fri, 27 Jul 2012 00:09:54 -0700 (PDT) Received: by 10.68.227.163 with SMTP id sb3mr11665626pbc.74.1343372993996; Fri, 27 Jul 2012 00:09:53 -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.53 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jul 2012 00:09:53 -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:53 -0700 (PDT) Received: by 10.68.238.68 with SMTP id vi4mr11277079pbc.123.1343372993777; Fri, 27 Jul 2012 00:09:53 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id qc5sm1355861pbb.6.2012.07.27.00.09.50 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jul 2012 00:09:53 -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 05/11] Bluetooth: Use devm_kzalloc in bt3c_cs.c file Date: Fri, 27 Jul 2012 12:38:35 +0530 Message-Id: <1343372921-18780-6-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: ALoCoQlT6pvJP2WiyArOXikMFtetlx6rKBAqfBRqiJ4SniGqRmiAPdrmYlhdDuyCnLglKthZVaun devm_kzalloc() eliminates the need to free memory explicitly thereby saving some cleanup code. Signed-off-by: Sachin Kamat --- drivers/bluetooth/bt3c_cs.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index 8925b6d..7ffd3f4 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c @@ -638,7 +638,7 @@ static int bt3c_probe(struct pcmcia_device *link) bt3c_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; @@ -654,10 +654,7 @@ static int bt3c_probe(struct pcmcia_device *link) static void bt3c_detach(struct pcmcia_device *link) { - bt3c_info_t *info = link->priv; - bt3c_release(link); - kfree(info); } static int bt3c_check_config(struct pcmcia_device *p_dev, void *priv_data)