Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752676Ab3GFRZR (ORCPT ); Sat, 6 Jul 2013 13:25:17 -0400 Received: from mail-pb0-f51.google.com ([209.85.160.51]:32854 "EHLO mail-pb0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751986Ab3GFRZP (ORCPT ); Sat, 6 Jul 2013 13:25:15 -0400 From: Guenter Roeck To: Jean Delvare , Greg Kroah-Hartman Cc: lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org, Guenter Roeck Subject: [RFC PATCH 0/5] Introduce and use device_create_groups Date: Sat, 6 Jul 2013 10:24:50 -0700 Message-Id: <1373131495-13465-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.7.9.7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1308 Lines: 28 This patch series introduces the new driver core API function device_create_groups(). device_create_groups() lets callers create devices as well as associated sysfs attributes with a single call. This avoids potential race conditions seen if sysfs attributes on new devices are created later. The rationale for the new API is that sysfs attributes should be created synchronously with device creation to avoid race conditions, as outlined in http://www.linuxfoundation.org/news-media/blogs/browse/2013/06/how-create-sysfs-file-correctly. Unfortunately, the only API function to create a device dynamically is device_create, which does not support the notion of adding sysfs attributes when creating a device. The new API call is similar but lets the caller provide a list of sysfs attribute groups. The first patch in the series introduces the new driver core API function. The second patch introduces hwmon_device_register_groups(), which uses the new API call. The remaining patches convert some hwmon drivers to use the new API to show and test its use. -- 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/