public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: "Robert P. J. Day" <rpjday@crashcourse.ca>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 02/11] DOCUMENTATION: Update overview.txt in Doc/driver-model.
Date: Tue, 26 Jul 2011 21:05:12 -0700	[thread overview]
Message-ID: <1311739521-11014-2-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <1311739521-11014-1-git-send-email-gregkh@suse.de>

From: "Robert P. J. Day" <rpjday@crashcourse.ca>

A few grammatical fixes, clarifications and corrections in just the
overview file for the driver model documentation.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 Documentation/driver-model/overview.txt |   52 ++++++++++++++++++++-----------
 1 files changed, 34 insertions(+), 18 deletions(-)

diff --git a/Documentation/driver-model/overview.txt b/Documentation/driver-model/overview.txt
index 07236ed..6a8f9a8 100644
--- a/Documentation/driver-model/overview.txt
+++ b/Documentation/driver-model/overview.txt
@@ -30,7 +30,7 @@ management, and hot plug. In particular, the model dictated by Intel and
 Microsoft (namely ACPI) ensures that almost every device on almost any bus
 on an x86-compatible system can work within this paradigm.  Of course,
 not every bus is able to support all such operations, although most
-buses support a most of those operations.
+buses support most of those operations.
 
 
 Downstream Access
@@ -46,25 +46,29 @@ struct pci_dev now looks like this:
 struct pci_dev {
 	...
 
-	struct device dev;
+	struct device dev;     /* Generic device interface */
+	...
 };
 
-Note first that it is statically allocated. This means only one allocation on
-device discovery. Note also that it is at the _end_ of struct pci_dev. This is
-to make people think about what they're doing when switching between the bus
-driver and the global driver; and to prevent against mindless casts between
-the two.
+Note first that the struct device dev within the struct pci_dev is
+statically allocated. This means only one allocation on device discovery.
+
+Note also that that struct device dev is not necessarily defined at the
+front of the pci_dev structure.  This is to make people think about what
+they're doing when switching between the bus driver and the global driver,
+and to discourage meaningless and incorrect casts between the two.
 
 The PCI bus layer freely accesses the fields of struct device. It knows about
 the structure of struct pci_dev, and it should know the structure of struct
 device. Individual PCI device drivers that have been converted to the current
 driver model generally do not and should not touch the fields of struct device,
-unless there is a strong compelling reason to do so.
+unless there is a compelling reason to do so.
 
-This abstraction is prevention of unnecessary pain during transitional phases.
-If the name of the field changes or is removed, then every downstream driver
-will break. On the other hand, if only the bus layer (and not the device
-layer) accesses struct device, it is only that layer that needs to change.
+The above abstraction prevents unnecessary pain during transitional phases.
+If it were not done this way, then when a field was renamed or removed, every
+downstream driver would break.  On the other hand, if only the bus layer
+(and not the device layer) accesses the struct device, it is only the bus
+layer that needs to change.
 
 
 User Interface
@@ -73,15 +77,27 @@ User Interface
 By virtue of having a complete hierarchical view of all the devices in the
 system, exporting a complete hierarchical view to userspace becomes relatively
 easy. This has been accomplished by implementing a special purpose virtual
-file system named sysfs. It is hence possible for the user to mount the
-whole sysfs filesystem anywhere in userspace.
+file system named sysfs.
+
+Almost all mainstream Linux distros mount this filesystem automatically; you
+can see some variation of the following in the output of the "mount" command:
+
+$ mount
+...
+none on /sys type sysfs (rw,noexec,nosuid,nodev)
+...
+$
+
+The auto-mounting of sysfs is typically accomplished by an entry similar to
+the following in the /etc/fstab file:
+
+none     	/sys	sysfs    defaults	  	0 0
 
-This can be done permanently by providing the following entry into the
-/etc/fstab (under the provision that the mount point does exist, of course):
+or something similar in the /lib/init/fstab file on Debian-based systems:
 
-none     	/sys	sysfs    defaults		0	0
+none            /sys    sysfs    nodev,noexec,nosuid    0 0
 
-Or by hand on the command line:
+If sysfs is not automatically mounted, you can always do it manually with:
 
 # mount -t sysfs sysfs /sys
 
-- 
1.7.6


  reply	other threads:[~2011-07-27  4:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26  4:57 [GIT PATCH] driver core merge for 3.1 Greg KH
2011-07-27  4:05 ` [PATCH 01/11] pti: pti_tty_install documentation mispelling Greg Kroah-Hartman
2011-07-27  4:05   ` Greg Kroah-Hartman [this message]
2011-07-27  4:05   ` [PATCH 03/11] DOCUMENTATION: Replace create_device() with device_create() Greg Kroah-Hartman
2011-07-27  4:05   ` [PATCH 04/11] driver-core: Kconfig grammar corrections in firmware configuration Greg Kroah-Hartman
2011-07-27  4:05   ` [PATCH 05/11] driver-core: modify FIRMWARE_IN_KERNEL help message Greg Kroah-Hartman
2011-07-27  4:05   ` [PATCH 06/11] driver core: add more help description for "path to uevent helper" Greg Kroah-Hartman
2011-07-27  4:05   ` [PATCH 07/11] Documentation/zh_CN: Fix messy code file email-clients.txt Greg Kroah-Hartman
2011-07-27  4:05   ` [PATCH 08/11] firmware: gsmi: remove sysfs entries when unload the module Greg Kroah-Hartman
2011-07-27  4:05   ` [PATCH 09/11] uio: uio_pdrv_genirq: Add OF support Greg Kroah-Hartman
2011-07-27  8:17     ` Hans J. Koch
2011-07-27  4:05   ` [PATCH 10/11] debugfs: add documentation for debugfs_create_x64 Greg Kroah-Hartman
2011-07-27  4:05   ` [PATCH 11/11] updated Documentation/ja_JP/SubmittingPatches Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311739521-11014-2-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpjday@crashcourse.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox