From patchwork Fri Jul 27 07:08:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 10298 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 3AAD823E56 for ; Fri, 27 Jul 2012 07:10:05 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 0BADCA190C3 for ; Fri, 27 Jul 2012 07:10:04 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so2864191yhp.11 for ; Fri, 27 Jul 2012 00:10:04 -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=8jWhc36PeSRyEQR9nIMK2JN8pv7G19232ziJN9ZiYTc=; b=h9D2TIFgcUznkhrY+qfWrlj5jJH53qWmWRRlEB3I662LCSRolcvMbnf8vG1dWdN4hH zqUwd/tpkFWZHQfE/C3bFp7gE5fjiASPSHq6grfoZFe1I0Lvtvq7LkRWpwZQmJuaRwz9 5qaPeSQ399Mc0HpIvSl01I4g/FXkJdDajJfdizUav3bLmz0cx30bYNB24xt8Uj2YgpG3 QwQa9SaiTjzPG3O1ik9yYhIllxjvzERRo6JlmjKx0YLX1WNP+vhkkTHJb1wqyA/bqkh5 /v73XD2C7L+oWOV7rAFj64HHZFQKmtSZTrGPVMX+DyeIzXBNTg3wBkiksEmWd7otu69i Rs2A== Received: by 10.50.182.229 with SMTP id eh5mr3727906igc.38.1343373004465; Fri, 27 Jul 2012 00:10:04 -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 bs3csp14918icc; Fri, 27 Jul 2012 00:10:04 -0700 (PDT) Received: by 10.236.91.48 with SMTP id g36mr1339713yhf.53.1343373003907; Fri, 27 Jul 2012 00:10:03 -0700 (PDT) Received: from mail-yx0-f178.google.com (mail-yx0-f178.google.com [209.85.213.178]) by mx.google.com with ESMTPS id e15si604691ann.30.2012.07.27.00.10.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jul 2012 00:10:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.213.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by yenl6 with SMTP id l6so3319341yen.37 for ; Fri, 27 Jul 2012 00:10:03 -0700 (PDT) Received: by 10.68.203.67 with SMTP id ko3mr11475313pbc.126.1343373003301; Fri, 27 Jul 2012 00:10:03 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id qc5sm1355861pbb.6.2012.07.27.00.10.00 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jul 2012 00:10:02 -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 08/11] Bluetooth: Use devm_kzalloc in btuart_cs.c file Date: Fri, 27 Jul 2012 12:38:38 +0530 Message-Id: <1343372921-18780-9-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: ALoCoQkE+LIGcviHU07tCHU6p8CTEvtBS25CmrShcOR1kTZXFA7Weg3aDA+ZNVWzFZFe37gwvucw devm_kzalloc() eliminates the need to free memory explicitly thereby saving some cleanup code. Signed-off-by: Sachin Kamat --- drivers/bluetooth/btuart_cs.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index 21e803a..2f510a8 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c @@ -567,7 +567,7 @@ static int btuart_probe(struct pcmcia_device *link) btuart_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; @@ -583,10 +583,7 @@ static int btuart_probe(struct pcmcia_device *link) static void btuart_detach(struct pcmcia_device *link) { - btuart_info_t *info = link->priv; - btuart_release(link); - kfree(info); } static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data)