lkml.org 
[lkml]   [2008]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 46/53] PNP: remove ratelimit on add resource failures
We used to have a fixed-size resource table.  If a device had
twenty resources when the table only had space for ten, we didn't
need ten warnings, so we added the ratelimit.

Now that we can dynamically allocate new resources, we should
only get failures if the allocation fails. That should be
rare enough that we don't need to ratelimit the messages.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

Index: work8/drivers/pnp/resource.c
===================================================================
--- work8.orig/drivers/pnp/resource.c 2008-04-17 14:39:12.000000000 -0600
+++ work8/drivers/pnp/resource.c 2008-04-17 14:40:09.000000000 -0600
@@ -538,15 +538,10 @@
{
struct pnp_resource *pnp_res;
struct resource *res;
- static unsigned char warned;

pnp_res = pnp_new_resource(dev, IORESOURCE_IRQ);
if (!pnp_res) {
- if (!warned) {
- dev_err(&dev->dev, "can't add resource for IRQ %d\n",
- irq);
- warned = 1;
- }
+ dev_err(&dev->dev, "can't add resource for IRQ %d\n", irq);
return NULL;
}

@@ -562,15 +557,10 @@
{
struct pnp_resource *pnp_res;
struct resource *res;
- static unsigned char warned;

pnp_res = pnp_new_resource(dev, IORESOURCE_DMA);
if (!pnp_res) {
- if (!warned) {
- dev_err(&dev->dev, "can't add resource for DMA %d\n",
- dma);
- warned = 1;
- }
+ dev_err(&dev->dev, "can't add resource for DMA %d\n", dma);
return NULL;
}

@@ -587,16 +577,11 @@
{
struct pnp_resource *pnp_res;
struct resource *res;
- static unsigned char warned;

pnp_res = pnp_new_resource(dev, IORESOURCE_IO);
if (!pnp_res) {
- if (!warned) {
- dev_err(&dev->dev, "can't add resource for IO "
- "0x%llx-0x%llx\n",(unsigned long long) start,
- (unsigned long long) end);
- warned = 1;
- }
+ dev_err(&dev->dev, "can't add resource for IO 0x%llx-0x%llx\n",
+ (unsigned long long) start, (unsigned long long) end);
return NULL;
}

@@ -613,16 +598,11 @@
{
struct pnp_resource *pnp_res;
struct resource *res;
- static unsigned char warned;

pnp_res = pnp_new_resource(dev, IORESOURCE_MEM);
if (!pnp_res) {
- if (!warned) {
- dev_err(&dev->dev, "can't add resource for MEM "
- "0x%llx-0x%llx\n",(unsigned long long) start,
- (unsigned long long) end);
- warned = 1;
- }
+ dev_err(&dev->dev, "can't add resource for MEM 0x%llx-0x%llx\n",
+ (unsigned long long) start, (unsigned long long) end);
return NULL;
}

--


\
 
 \ /
  Last update: 2008-04-18 23:13    [W:0.159 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site