Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1608076
| Path | csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Jeffy Chen <jeffy.chen@rock-chips.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 1/2] PCI: return resource_entry in pci_add_resource helpers |
| Date | Fri, 24 Mar 2017 03:00:02 +0100 |
| Message-ID | <tomGe-2CL-29@gated-at.bofh.it> (permalink) |
| References | <tomGe-2CL-23@gated-at.bofh.it> |
| X-Original-To | linux-kernel@vger.kernel.org |
| X-263anti-Spam | KSV:0; |
| X-Mail-Delivery | 1 |
| X-Abs-Checked | 4 |
| X-Rl-Sender | jeffy.chen@rock-chips.com |
| X-Fst-To | linux-kernel@vger.kernel.org |
| X-Sender-IP | 103.29.142.67 |
| X-Login-Name | jeffy.chen@rock-chips.com |
| X-Unique-Tag | <aec59ef678ead20e17262389b2f84695> |
| X-Sender | cjf@rock-chips.com |
| X-Mailer | git-send-email 2.1.4 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 69 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | robh@kernel.org, toshi.kani@hpe.com, shawn.lin@rock-chips.com, briannorris@chromium.org, dianders@chromium.org, bhelgaas@google.com, dtor@chromium.org, Jeffy Chen <jeffy.chen@rock-chips.com>, linux-pci@vger.kernel.org |
| X-Original-Date | Fri, 24 Mar 2017 09:50:40 +0800 |
| X-Original-Message-ID | <1490320241-9250-2-git-send-email-jeffy.chen@rock-chips.com> |
| X-Original-References | <1490320241-9250-1-git-send-email-jeffy.chen@rock-chips.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1608076 |
Show key headers only | View raw
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
Changes in v3: None
Changes in v2: None
drivers/pci/bus.c | 13 ++++++++-----
include/linux/pci.h | 8 +++++---
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index bc56cf1..36a1861 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -17,25 +17,28 @@
#include "pci.h"
-void pci_add_resource_offset(struct list_head *resources, struct resource *res,
- resource_size_t offset)
+struct resource_entry *pci_add_resource_offset(struct list_head *resources,
+ struct resource *res,
+ resource_size_t offset)
{
struct resource_entry *entry;
entry = resource_list_create_entry(res, 0);
if (!entry) {
printk(KERN_ERR "PCI: can't add host bridge window %pR\n", res);
- return;
+ return NULL;
}
entry->offset = offset;
resource_list_add_tail(entry, resources);
+ return entry;
}
EXPORT_SYMBOL(pci_add_resource_offset);
-void pci_add_resource(struct list_head *resources, struct resource *res)
+struct resource_entry *pci_add_resource(struct list_head *resources,
+ struct resource *res)
{
- pci_add_resource_offset(resources, res, 0);
+ return pci_add_resource_offset(resources, res, 0);
}
EXPORT_SYMBOL(pci_add_resource);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index eb3da1a..ab16abe 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1167,9 +1167,11 @@ void pci_release_selected_regions(struct pci_dev *, int);
/* drivers/pci/bus.c */
struct pci_bus *pci_bus_get(struct pci_bus *bus);
void pci_bus_put(struct pci_bus *bus);
-void pci_add_resource(struct list_head *resources, struct resource *res);
-void pci_add_resource_offset(struct list_head *resources, struct resource *res,
- resource_size_t offset);
+struct resource_entry *pci_add_resource(struct list_head *resources,
+ struct resource *res);
+struct resource_entry *pci_add_resource_offset(struct list_head *resources,
+ struct resource *res,
+ resource_size_t offset);
void pci_free_resource_list(struct list_head *resources);
void pci_bus_add_resource(struct pci_bus *bus, struct resource *res,
unsigned int flags);
--
2.1.4
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v3 0/2] Fix memory leak in of_pci_get_host_bridge_resources Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-03-24 03:00 +0100 [PATCH v3 1/2] PCI: return resource_entry in pci_add_resource helpers Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-03-24 03:00 +0100
csiph-web