Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764977AbYF0XBj (ORCPT ); Fri, 27 Jun 2008 19:01:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1763399AbYF0W6x (ORCPT ); Fri, 27 Jun 2008 18:58:53 -0400 Received: from g5t0006.atlanta.hp.com ([15.192.0.43]:22907 "EHLO g5t0006.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761640AbYF0W6q (ORCPT ); Fri, 27 Jun 2008 18:58:46 -0400 Message-Id: <20080627225759.051310841@ldl.fc.hp.com> References: <20080627225651.663174474@ldl.fc.hp.com> User-Agent: quilt/0.46-1 Date: Fri, 27 Jun 2008 16:56:55 -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 04/28] PNP: add pnp_resource_type_name() helper function Content-Disposition: inline; filename=pnp-add-resource-type-name 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: 1772 Lines: 51 This patch adds a "pnp_resource_type_name(struct resource *)" that returns the string resource type. This will be used by the sysfs "show resources" function and the debug resource dump function. Signed-off-by: Bjorn Helgaas Index: work10/drivers/pnp/base.h =================================================================== --- work10.orig/drivers/pnp/base.h 2008-05-15 15:23:27.000000000 -0600 +++ work10/drivers/pnp/base.h 2008-05-15 15:23:29.000000000 -0600 @@ -43,6 +43,7 @@ int pnp_check_mem(struct pnp_dev *dev, s int pnp_check_irq(struct pnp_dev *dev, struct resource *res); int pnp_check_dma(struct pnp_dev *dev, struct resource *res); +char *pnp_resource_type_name(struct resource *res); void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc); void pnp_init_resource(struct resource *res); Index: work10/drivers/pnp/support.c =================================================================== --- work10.orig/drivers/pnp/support.c 2008-05-15 15:23:23.000000000 -0600 +++ work10/drivers/pnp/support.c 2008-05-15 15:23:29.000000000 -0600 @@ -52,6 +52,21 @@ void pnp_eisa_id_to_string(u32 id, char str[7] = '\0'; } +char *pnp_resource_type_name(struct resource *res) +{ + switch (pnp_resource_type(res)) { + case IORESOURCE_IO: + return "io"; + case IORESOURCE_MEM: + return "mem"; + case IORESOURCE_IRQ: + return "irq"; + case IORESOURCE_DMA: + return "dma"; + } + return NULL; +} + void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc) { #ifdef DEBUG -- -- 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/