parisc/stifb: Keep track of hardware path of graphics card

commit b046f98481 upstream.

Keep the pa_path (hardware path) of the graphics card in sti_struct and use
this info to give more useful info which card is currently being used.

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org   # v5.10+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Helge Deller 2022-06-02 13:55:26 +02:00 коммит произвёл Greg Kroah-Hartman
Родитель 8b8fe78cae
Коммит e639a66ca9
3 изменённых файлов: 14 добавлений и 9 удалений

Просмотреть файл

@ -46,6 +46,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/font.h> #include <linux/font.h>
#include <linux/crc32.h> #include <linux/crc32.h>
#include <linux/fb.h>
#include <asm/io.h> #include <asm/io.h>
@ -392,7 +393,9 @@ static int __init sticonsole_init(void)
for (i = 0; i < MAX_NR_CONSOLES; i++) for (i = 0; i < MAX_NR_CONSOLES; i++)
font_data[i] = STI_DEF_FONT; font_data[i] = STI_DEF_FONT;
pr_info("sticon: Initializing STI text console.\n"); pr_info("sticon: Initializing STI text console on %s at [%s]\n",
sticon_sti->sti_data->inq_outptr.dev_name,
sticon_sti->pa_path);
console_lock(); console_lock();
err = do_take_over_console(&sti_con, 0, MAX_NR_CONSOLES - 1, err = do_take_over_console(&sti_con, 0, MAX_NR_CONSOLES - 1,
PAGE0->mem_cons.cl_class != CL_DUPLEX); PAGE0->mem_cons.cl_class != CL_DUPLEX);

Просмотреть файл

@ -34,7 +34,7 @@
#include "../fbdev/sticore.h" #include "../fbdev/sticore.h"
#define STI_DRIVERVERSION "Version 0.9b" #define STI_DRIVERVERSION "Version 0.9c"
static struct sti_struct *default_sti __read_mostly; static struct sti_struct *default_sti __read_mostly;
@ -503,7 +503,7 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
if (!fbfont) if (!fbfont)
return NULL; return NULL;
pr_info("STI selected %ux%u framebuffer font %s for sticon\n", pr_info(" using %ux%u framebuffer font %s\n",
fbfont->width, fbfont->height, fbfont->name); fbfont->width, fbfont->height, fbfont->name);
bpc = ((fbfont->width+7)/8) * fbfont->height; bpc = ((fbfont->width+7)/8) * fbfont->height;
@ -947,6 +947,7 @@ out_err:
static void sticore_check_for_default_sti(struct sti_struct *sti, char *path) static void sticore_check_for_default_sti(struct sti_struct *sti, char *path)
{ {
pr_info(" located at [%s]\n", sti->pa_path);
if (strcmp (path, default_sti_path) == 0) if (strcmp (path, default_sti_path) == 0)
default_sti = sti; default_sti = sti;
} }
@ -958,7 +959,6 @@ static void sticore_check_for_default_sti(struct sti_struct *sti, char *path)
*/ */
static int __init sticore_pa_init(struct parisc_device *dev) static int __init sticore_pa_init(struct parisc_device *dev)
{ {
char pa_path[21];
struct sti_struct *sti = NULL; struct sti_struct *sti = NULL;
int hpa = dev->hpa.start; int hpa = dev->hpa.start;
@ -971,8 +971,8 @@ static int __init sticore_pa_init(struct parisc_device *dev)
if (!sti) if (!sti)
return 1; return 1;
print_pa_hwpath(dev, pa_path); print_pa_hwpath(dev, sti->pa_path);
sticore_check_for_default_sti(sti, pa_path); sticore_check_for_default_sti(sti, sti->pa_path);
return 0; return 0;
} }
@ -1008,9 +1008,8 @@ static int sticore_pci_init(struct pci_dev *pd, const struct pci_device_id *ent)
sti = sti_try_rom_generic(rom_base, fb_base, pd); sti = sti_try_rom_generic(rom_base, fb_base, pd);
if (sti) { if (sti) {
char pa_path[30]; print_pci_hwpath(pd, sti->pa_path);
print_pci_hwpath(pd, pa_path); sticore_check_for_default_sti(sti, sti->pa_path);
sticore_check_for_default_sti(sti, pa_path);
} }
if (!sti) { if (!sti) {

Просмотреть файл

@ -370,6 +370,9 @@ struct sti_struct {
/* pointer to all internal data */ /* pointer to all internal data */
struct sti_all_data *sti_data; struct sti_all_data *sti_data;
/* pa_path of this device */
char pa_path[24];
}; };