diff options
Diffstat (limited to 'kernel/drivers/base')
-rw-r--r-- | kernel/drivers/base/devres.c | 4 | ||||
-rw-r--r-- | kernel/drivers/base/node.c | 10 | ||||
-rw-r--r-- | kernel/drivers/base/platform.c | 8 | ||||
-rw-r--r-- | kernel/drivers/base/power/clock_ops.c | 4 |
4 files changed, 15 insertions, 11 deletions
diff --git a/kernel/drivers/base/devres.c b/kernel/drivers/base/devres.c index c8a53d1e0..875464690 100644 --- a/kernel/drivers/base/devres.c +++ b/kernel/drivers/base/devres.c @@ -297,10 +297,10 @@ void * devres_get(struct device *dev, void *new_res, if (!dr) { add_dr(dev, &new_dr->node); dr = new_dr; - new_dr = NULL; + new_res = NULL; } spin_unlock_irqrestore(&dev->devres_lock, flags); - devres_free(new_dr); + devres_free(new_res); return dr->data; } diff --git a/kernel/drivers/base/node.c b/kernel/drivers/base/node.c index a2aa65b42..b10479c87 100644 --- a/kernel/drivers/base/node.c +++ b/kernel/drivers/base/node.c @@ -388,6 +388,16 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid) for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) { int page_nid; + /* + * memory block could have several absent sections from start. + * skip pfn range from absent section + */ + if (!pfn_present(pfn)) { + pfn = round_down(pfn + PAGES_PER_SECTION, + PAGES_PER_SECTION) - 1; + continue; + } + page_nid = get_nid_for_pfn(pfn); if (page_nid < 0) continue; diff --git a/kernel/drivers/base/platform.c b/kernel/drivers/base/platform.c index ebf034b97..7403de948 100644 --- a/kernel/drivers/base/platform.c +++ b/kernel/drivers/base/platform.c @@ -375,9 +375,7 @@ int platform_device_add(struct platform_device *pdev) while (--i >= 0) { struct resource *r = &pdev->resource[i]; - unsigned long type = resource_type(r); - - if (type == IORESOURCE_MEM || type == IORESOURCE_IO) + if (r->parent) release_resource(r); } @@ -408,9 +406,7 @@ void platform_device_del(struct platform_device *pdev) for (i = 0; i < pdev->num_resources; i++) { struct resource *r = &pdev->resource[i]; - unsigned long type = resource_type(r); - - if (type == IORESOURCE_MEM || type == IORESOURCE_IO) + if (r->parent) release_resource(r); } } diff --git a/kernel/drivers/base/power/clock_ops.c b/kernel/drivers/base/power/clock_ops.c index c7b0fcebf..ac3c07db9 100644 --- a/kernel/drivers/base/power/clock_ops.c +++ b/kernel/drivers/base/power/clock_ops.c @@ -37,7 +37,7 @@ struct pm_clock_entry { * @dev: The device for the given clock * @ce: PM clock entry corresponding to the clock. */ -static inline int __pm_clk_enable(struct device *dev, struct pm_clock_entry *ce) +static inline void __pm_clk_enable(struct device *dev, struct pm_clock_entry *ce) { int ret; @@ -49,8 +49,6 @@ static inline int __pm_clk_enable(struct device *dev, struct pm_clock_entry *ce) dev_err(dev, "%s: failed to enable clk %p, error %d\n", __func__, ce->clk, ret); } - - return ret; } /** |