Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756836Ab1BQV6b (ORCPT ); Thu, 17 Feb 2011 16:58:31 -0500 Received: from kroah.org ([198.145.64.141]:51740 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755965Ab1BQV62 (ORCPT ); Thu, 17 Feb 2011 16:58:28 -0500 Date: Thu, 17 Feb 2011 13:56:08 -0800 From: Greg KH To: Mike Waychison Cc: Olof Johansson , Andi Kleen , Alan Cox , Robert Lippert , Jon Mayer , Duncan Laurie , Aaron Durbin , linux-kernel@vger.kernel.org, Tim Hockin , David Hendrix , linux-api@vger.kernel.org Subject: Re: [PATCH v1 2/5] firmware: Basic dmi-sysfs support Message-ID: <20110217215608.GA2451@kroah.com> References: <20110217212754.3967.98648.stgit@mike.mtv.corp.google.com> <20110217212805.3967.47547.stgit@mike.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110217212805.3967.47547.stgit@mike.mtv.corp.google.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2327 Lines: 92 Overall, this looks great, just a few minor comments below: On Thu, Feb 17, 2011 at 01:28:05PM -0800, Mike Waychison wrote: > +config DMI_SYSFS > + tristate "DMI table support in sysfs" > + depends on SYSFS && DMI > + default X86 Huh? Default should be 'N' for any new feature, unless it keeps your machine from booting. I think you want this option to depend on X86 though, right? > + help > + Say Y or M here to enable the exporting of the raw DMI table > + data via sysfs. This is useful for consuming the data without > + requiring any access to /dev/mem at all. Tables are found > + under /sys/firmware/dmi when this option is enabled and > + loaded. I just realized (due to other work I'm doing on a laptop) that we have a bunch of entries today in /sys/class/dmi/id which is a pointer to the dmi "device". Now I think this really is different (these are the raw DMI tables), but this doesn't have anything to do with that code, right? > + * > + * Copyright 2010 Google, Inc. It's 2011 :) > +static int __init dmi_sysfs_init(void) > +{ > + int error = -ENOMEM; > + int val; > + > + /* Set up our directory */ > + dmi_kobj = kobject_create_and_add("dmi", firmware_kobj); > + if (!dmi_kobj) > + goto err; > + > + dmi_kset = kset_create_and_add("entries", NULL, dmi_kobj); > + if (!dmi_kset) > + goto err; > + > + val = 0; > + error = dmi_walk(dmi_sysfs_register_handle, &val); > + if (error) > + goto err; > + if (val) { > + error = val; > + goto err; > + } > + > + pr_info("dmi-sysfs: loaded.\n"); Is this really needed? pr_dbg() instead please? > + > + return 0; > +err: > + cleanup_entry_list(); > + kset_unregister(dmi_kset); > + kobject_put(dmi_kobj); > + return error; > +} > + > +/* clean up everything. */ > +static void __exit dmi_sysfs_exit(void) > +{ > + pr_info("dmi-sysfs: unloading.\n"); > + cleanup_entry_list(); > + kset_unregister(dmi_kset); > + kobject_put(dmi_kobj); > +} > + > +module_init(dmi_sysfs_init); > +module_exit(dmi_sysfs_exit); > + > +MODULE_AUTHOR("Google, Inc."); You don't want your name here? thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/