Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753204AbZCaTZG (ORCPT ); Tue, 31 Mar 2009 15:25:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753512AbZCaTYy (ORCPT ); Tue, 31 Mar 2009 15:24:54 -0400 Received: from mail-in-07.arcor-online.net ([151.189.21.47]:56106 "EHLO mail-in-07.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752188AbZCaTYx (ORCPT ); Tue, 31 Mar 2009 15:24:53 -0400 X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-03.arcor-online.net B52772C2C86 From: Bodo Eggert <7eggert@gmx.de> Subject: Re: Sysfs with no struc device ? To: Ayman KHAMOUMA , linux-kernel@vger.kernel.org Reply-To: 7eggert@gmx.de Date: Tue, 31 Mar 2009 21:24:49 +0200 References: User-Agent: KNode/0.10.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-Id: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1031 Lines: 15 Ayman KHAMOUMA wrote: > I'm trying to write a module which is supposed to write the state of a pin in > a sysfs file. As it is neither a char device nor a block device, or anything > else, I suposed taht I don't need any struct device...I mau be mistaking... So > my question is: How can I create this file in sysfs without any struct device > ? Why don't you create a char device: Reader will get one char per status change (and one initial char, off cause), while mmap will map the flag? You'd get the interface you want (except the path beginning with /sys), and more. Or, if you wanted a more sophisticated way, you could use a one-button-zero-axis joystick device, very similar to the parport joystick. But I doubt it would make sense for your usecase? -- 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/