提交 33097895 编写于 作者: H Helge Deller 提交者: Zheng Zengkai

parisc: Fix device names in /proc/iomem

stable inclusion
from stable-v5.10.137
commit b0dfba6d3bf2fa78bd7c62cae61496279f62ced2
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60PLB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b0dfba6d3bf2fa78bd7c62cae61496279f62ced2

--------------------------------

commit cab56b51 upstream.

Fix the output of /proc/iomem to show the real hardware device name
including the pa_pathname, e.g. "Merlin 160 Core Centronics [8:16:0]".
Up to now only the pa_pathname ("[8:16.0]") was shown.
Signed-off-by: NHelge Deller <deller@gmx.de>
Cc: <stable@vger.kernel.org> # v4.9+
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 c2f8219d
...@@ -521,7 +521,6 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path) ...@@ -521,7 +521,6 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path)
dev->id.hversion_rev = iodc_data[1] & 0x0f; dev->id.hversion_rev = iodc_data[1] & 0x0f;
dev->id.sversion = ((iodc_data[4] & 0x0f) << 16) | dev->id.sversion = ((iodc_data[4] & 0x0f) << 16) |
(iodc_data[5] << 8) | iodc_data[6]; (iodc_data[5] << 8) | iodc_data[6];
dev->hpa.name = parisc_pathname(dev);
dev->hpa.start = hpa; dev->hpa.start = hpa;
/* This is awkward. The STI spec says that gfx devices may occupy /* This is awkward. The STI spec says that gfx devices may occupy
* 32MB or 64MB. Unfortunately, we don't know how to tell whether * 32MB or 64MB. Unfortunately, we don't know how to tell whether
...@@ -535,10 +534,10 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path) ...@@ -535,10 +534,10 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path)
dev->hpa.end = hpa + 0xfff; dev->hpa.end = hpa + 0xfff;
} }
dev->hpa.flags = IORESOURCE_MEM; dev->hpa.flags = IORESOURCE_MEM;
name = parisc_hardware_description(&dev->id); dev->hpa.name = dev->name;
if (name) { name = parisc_hardware_description(&dev->id) ? : "unknown";
strlcpy(dev->name, name, sizeof(dev->name)); snprintf(dev->name, sizeof(dev->name), "%s [%s]",
} name, parisc_pathname(dev));
/* Silently fail things like mouse ports which are subsumed within /* Silently fail things like mouse ports which are subsumed within
* the keyboard controller * the keyboard controller
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册