Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Implementing an Interrupt Handler > pint_probe Function

pint_probe Function

The pint_probe function is the device_probe implementation for this driver. Here is its function definition (again):

static int
pint_probe(device_t dev)
{
        /* probe() is always OK. */
        device_set_desc(dev, "Interrupt Handler Example");

      return (BUS_PROBE_SPECIFIC);
}

As you can see, this function always returns the success code BUS_PROBE_SPECIFIC, so Example 8-1 attaches to every device it probes. This may seem erroneous, but it is the correct behavior, as devices identified by a device_identify routine, using BUS_ADD_CHILD, are probed only by drivers with the same name. In this case, the identified device and driver name is PINT_NAME.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial