Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764692AbYF0XAJ (ORCPT ); Fri, 27 Jun 2008 19:00:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761758AbYF0W6r (ORCPT ); Fri, 27 Jun 2008 18:58:47 -0400 Received: from g5t0008.atlanta.hp.com ([15.192.0.45]:49082 "EHLO g5t0008.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761279AbYF0W6o (ORCPT ); Fri, 27 Jun 2008 18:58:44 -0400 Message-Id: <20080627225758.850118474@ldl.fc.hp.com> References: <20080627225651.663174474@ldl.fc.hp.com> User-Agent: quilt/0.46-1 Date: Fri, 27 Jun 2008 16:56:54 -0600 From: Bjorn Helgaas To: Len Brown To: Andi Kleen Cc: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Adam Belay Cc: Adam M Belay Cc: Li Shaohua Cc: Matthieu Castet Cc: Thomas Renninger Cc: Rene Herman Cc: Jaroslav Kysela Cc: Andrew Morton Cc: Takashi Iwai Cc: Jiri Slaby Cc: David Howells Cc: Bartlomiej Zolnierkiewicz Subject: [patch 03/28] PNP: add pnp_resource_type() internal interface Content-Disposition: inline; filename=pnp-add-pnp_resource_type X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1529 Lines: 40 Given a struct resource, this returns the type (IO, MEM, IRQ, DMA). Signed-off-by: Bjorn Helgaas Index: work10/drivers/pnp/base.h =================================================================== --- work10.orig/drivers/pnp/base.h 2008-05-15 15:23:24.000000000 -0600 +++ work10/drivers/pnp/base.h 2008-05-15 15:23:27.000000000 -0600 @@ -46,6 +46,7 @@ int pnp_check_dma(struct pnp_dev *dev, s void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc); void pnp_init_resource(struct resource *res); +int pnp_resource_type(struct resource *res); struct pnp_resource *pnp_get_pnp_resource(struct pnp_dev *dev, unsigned int type, unsigned int num); Index: work10/drivers/pnp/resource.c =================================================================== --- work10.orig/drivers/pnp/resource.c 2008-05-15 15:22:36.000000000 -0600 +++ work10/drivers/pnp/resource.c 2008-05-15 15:23:27.000000000 -0600 @@ -499,6 +499,12 @@ int pnp_check_dma(struct pnp_dev *dev, s #endif } +int pnp_resource_type(struct resource *res) +{ + return res->flags & (IORESOURCE_IO | IORESOURCE_MEM | + IORESOURCE_IRQ | IORESOURCE_DMA); +} + struct pnp_resource *pnp_get_pnp_resource(struct pnp_dev *dev, unsigned int type, unsigned int num) { -- -- 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/