[package] flashrom: use msr path compatible w/ hotplug2
[openwrt/svn-archive/archive.git] / utils / flashrom / patches / 001-msr_dev_path.patch
1 --- flashrom-0.9.3/physmap.c.orig 2010-10-05 20:56:44.000000000 -0600
2 +++ flashrom-0.9.3/physmap.c 2011-03-29 20:26:22.000000000 -0600
3 @@ -352,7 +352,7 @@ int setup_cpu_msr(int cpu)
4 {
5 char msrfilename[64];
6 memset(msrfilename, 0, sizeof(msrfilename));
7 - snprintf(msrfilename, sizeof(msrfilename), "/dev/cpu/%d/msr", cpu);
8 + snprintf(msrfilename, sizeof(msrfilename), "/dev/msr%d", cpu);
9
10 if (fd_msr != -1) {
11 msg_pinfo("MSR was already initialized\n");
12 @@ -362,7 +362,8 @@ int setup_cpu_msr(int cpu)
13 fd_msr = open(msrfilename, O_RDWR);
14
15 if (fd_msr < 0) {
16 - perror("Error while opening /dev/cpu/0/msr");
17 + fprintf(stderr, "Error while opening %s: %s\n", msrfilename,
18 + strerror(errno));
19 msg_pinfo("Did you run 'modprobe msr'?\n");
20 return -1;
21 }