From patchwork Mon Jun 14 22:33:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkatesh Pallipadi X-Patchwork-Id: 106082 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5EMbKsT015102 for ; Mon, 14 Jun 2010 22:37:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757179Ab0FNWhT (ORCPT ); Mon, 14 Jun 2010 18:37:19 -0400 Received: from smtp-out.google.com ([74.125.121.35]:1541 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757143Ab0FNWhS (ORCPT ); Mon, 14 Jun 2010 18:37:18 -0400 Received: from kpbe14.cbf.corp.google.com (kpbe14.cbf.corp.google.com [172.25.105.78]) by smtp-out.google.com with ESMTP id o5EMbG2L030450 for ; Mon, 14 Jun 2010 15:37:16 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1276555036; bh=QHgk3dnYk2UB83cysjZpngVUQHw=; h=From:To:Cc:Subject:Date:Message-Id; b=wuEq+Uj+8ec9UkJ2+HV5tEF2CSLYzWZVcBdEJdjboE4jgQ5oPZvoDhImv5O9iD9e0 /1ByponVgAkBmWCR1M8ig== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=from:to:cc:subject:date:message-id:x-mailer; b=dokvojPs7Kpr7rY65J66JYAhREHE6lGVSMNB9z6uEPioavFwBXP6H2w1Qqzv5BUjM UMyvPm9ktSkO5nbx9Q2CA== Received: from pwj3 (pwj3.prod.google.com [10.241.219.67]) by kpbe14.cbf.corp.google.com with ESMTP id o5EMavm3022360 for ; Mon, 14 Jun 2010 15:37:15 -0700 Received: by pwj3 with SMTP id 3so3621466pwj.7 for ; Mon, 14 Jun 2010 15:37:15 -0700 (PDT) Received: by 10.140.248.7 with SMTP id v7mr4985346rvh.252.1276555034829; Mon, 14 Jun 2010 15:37:14 -0700 (PDT) Received: from localhost.localdomain (tippy.mtv.corp.google.com [172.22.64.214]) by mx.google.com with ESMTPS id l29sm5135350rvb.16.2010.06.14.15.37.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 14 Jun 2010 15:37:13 -0700 (PDT) From: Venkatesh Pallipadi To: Len Brown Cc: ACPI list , Venkatesh Pallipadi Subject: [PATCH] cpuidle: Remove module_get/put of registered driver Date: Mon, 14 Jun 2010 15:33:37 -0700 Message-Id: <1276554817-3259-1-git-send-email-venki@google.com> X-Mailer: git-send-email 1.7.0.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 14 Jun 2010 22:37:21 +0000 (UTC) diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 1994885..c318692 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -275,8 +275,6 @@ static int __cpuidle_register_device(struct cpuidle_device *dev) if (!sys_dev) return -EINVAL; - if (!try_module_get(cpuidle_driver->owner)) - return -EINVAL; init_completion(&dev->kobj_unregister); @@ -284,10 +282,8 @@ static int __cpuidle_register_device(struct cpuidle_device *dev) per_cpu(cpuidle_devices, dev->cpu) = dev; list_add(&dev->device_list, &cpuidle_detected_devices); - if ((ret = cpuidle_add_sysfs(sys_dev))) { - module_put(cpuidle_driver->owner); + if ((ret = cpuidle_add_sysfs(sys_dev))) return ret; - } dev->registered = 1; return 0; @@ -341,8 +337,6 @@ void cpuidle_unregister_device(struct cpuidle_device *dev) per_cpu(cpuidle_devices, dev->cpu) = NULL; cpuidle_resume_and_unlock(); - - module_put(cpuidle_driver->owner); } EXPORT_SYMBOL_GPL(cpuidle_unregister_device);