diff mbox series

video: offb: Pass actual name in offb_init_palette_hacks

Message ID 20181207125844.18775-1-malat@debian.org (mailing list archive)
State New, archived
Headers show
Series video: offb: Pass actual name in offb_init_palette_hacks | expand

Commit Message

Mathieu Malaterre Dec. 7, 2018, 12:58 p.m. UTC
This is a partial revert of commit 5c63e407aaab ("fbdev: Convert to
using %pOFn instead of device_node.name"). This is the minimal work to
get a Mac Mini G4 back to a bootable state. The function
offb_init_palette_hacks would need to handle the case where `name` has
been set to NULL.

Cc: Rob Herring <robh@kernel.org>
Fixes: 5c63e407aaab ("fbdev: Convert to using %pOFn instead of device_node.name")
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 drivers/video/fbdev/offb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mathieu Malaterre Dec. 20, 2018, 4:10 p.m. UTC | #1
Rob, any comment ?

On Fri, Dec 7, 2018 at 1:59 PM Mathieu Malaterre <malat@debian.org> wrote:
>
> This is a partial revert of commit 5c63e407aaab ("fbdev: Convert to
> using %pOFn instead of device_node.name"). This is the minimal work to
> get a Mac Mini G4 back to a bootable state. The function
> offb_init_palette_hacks would need to handle the case where `name` has
> been set to NULL.
>
> Cc: Rob Herring <robh@kernel.org>
> Fixes: 5c63e407aaab ("fbdev: Convert to using %pOFn instead of device_node.name")
> Cc: stable@vger.kernel.org # v4.19+
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
> ---
>  drivers/video/fbdev/offb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
> index 31f769d67195..6e75851f8142 100644
> --- a/drivers/video/fbdev/offb.c
> +++ b/drivers/video/fbdev/offb.c
> @@ -648,7 +648,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
>                 /* kludge for valkyrie */
>                 if (strcmp(dp->name, "valkyrie") == 0)
>                         address += 0x1000;
> -               offb_init_fb(no_real_node ? "bootx" : NULL,
> +               offb_init_fb(no_real_node ? "bootx" : dp->name,
>                              width, height, depth, pitch, address,
>                              foreign_endian, no_real_node ? NULL : dp);
>         }
> --
> 2.19.2
>
Mathieu Malaterre Dec. 23, 2018, 5:27 p.m. UTC | #2
Patch is far from perfect but was tested also by: Elimar Riesebieter
riesebie@lxtec.de

Le jeu. 20 déc. 2018 17:10, Mathieu Malaterre <malat@debian.org> a écrit :

> Rob, any comment ?
>
> On Fri, Dec 7, 2018 at 1:59 PM Mathieu Malaterre <malat@debian.org> wrote:
> >
> > This is a partial revert of commit 5c63e407aaab ("fbdev: Convert to
> > using %pOFn instead of device_node.name"). This is the minimal work to
> > get a Mac Mini G4 back to a bootable state. The function
> > offb_init_palette_hacks would need to handle the case where `name` has
> > been set to NULL.
> >
> > Cc: Rob Herring <robh@kernel.org>
> > Fixes: 5c63e407aaab ("fbdev: Convert to using %pOFn instead of
> device_node.name")
> > Cc: stable@vger.kernel.org # v4.19+
> > Signed-off-by: Mathieu Malaterre <malat@debian.org>
> > ---
> >  drivers/video/fbdev/offb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
> > index 31f769d67195..6e75851f8142 100644
> > --- a/drivers/video/fbdev/offb.c
> > +++ b/drivers/video/fbdev/offb.c
> > @@ -648,7 +648,7 @@ static void __init offb_init_nodriver(struct
> device_node *dp, int no_real_node)
> >                 /* kludge for valkyrie */
> >                 if (strcmp(dp->name, "valkyrie") == 0)
> >                         address += 0x1000;
> > -               offb_init_fb(no_real_node ? "bootx" : NULL,
> > +               offb_init_fb(no_real_node ? "bootx" : dp->name,
> >                              width, height, depth, pitch, address,
> >                              foreign_endian, no_real_node ? NULL : dp);
> >         }
> > --
> > 2.19.2
> >
>
<div dir="auto"><div>Patch is far from perfect but was tested also by: Elimar Riesebieter <a href="mailto:riesebie@lxtec.de">riesebie@lxtec.de</a><br><br><div class="gmail_quote"><div dir="ltr">Le jeu. 20 déc. 2018 17:10, Mathieu Malaterre &lt;<a href="mailto:malat@debian.org">malat@debian.org</a>&gt; a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Rob, any comment ?<br>
<br>
On Fri, Dec 7, 2018 at 1:59 PM Mathieu Malaterre &lt;<a href="mailto:malat@debian.org" target="_blank" rel="noreferrer">malat@debian.org</a>&gt; wrote:<br>
&gt;<br>
&gt; This is a partial revert of commit 5c63e407aaab (&quot;fbdev: Convert to<br>
&gt; using %pOFn instead of <a href="http://device_node.name" rel="noreferrer noreferrer" target="_blank">device_node.name</a>&quot;). This is the minimal work to<br>
&gt; get a Mac Mini G4 back to a bootable state. The function<br>
&gt; offb_init_palette_hacks would need to handle the case where `name` has<br>
&gt; been set to NULL.<br>
&gt;<br>
&gt; Cc: Rob Herring &lt;<a href="mailto:robh@kernel.org" target="_blank" rel="noreferrer">robh@kernel.org</a>&gt;<br>
&gt; Fixes: 5c63e407aaab (&quot;fbdev: Convert to using %pOFn instead of <a href="http://device_node.name" rel="noreferrer noreferrer" target="_blank">device_node.name</a>&quot;)<br>
&gt; Cc: <a href="mailto:stable@vger.kernel.org" target="_blank" rel="noreferrer">stable@vger.kernel.org</a> # v4.19+<br>
&gt; Signed-off-by: Mathieu Malaterre &lt;<a href="mailto:malat@debian.org" target="_blank" rel="noreferrer">malat@debian.org</a>&gt;<br>
&gt; ---<br>
&gt;  drivers/video/fbdev/offb.c | 2 +-<br>
&gt;  1 file changed, 1 insertion(+), 1 deletion(-)<br>
&gt;<br>
&gt; diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c<br>
&gt; index 31f769d67195..6e75851f8142 100644<br>
&gt; --- a/drivers/video/fbdev/offb.c<br>
&gt; +++ b/drivers/video/fbdev/offb.c<br>
&gt; @@ -648,7 +648,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)<br>
&gt;                 /* kludge for valkyrie */<br>
&gt;                 if (strcmp(dp-&gt;name, &quot;valkyrie&quot;) == 0)<br>
&gt;                         address += 0x1000;<br>
&gt; -               offb_init_fb(no_real_node ? &quot;bootx&quot; : NULL,<br>
&gt; +               offb_init_fb(no_real_node ? &quot;bootx&quot; : dp-&gt;name,<br>
&gt;                              width, height, depth, pitch, address,<br>
&gt;                              foreign_endian, no_real_node ? NULL : dp);<br>
&gt;         }<br>
&gt; --<br>
&gt; 2.19.2<br>
&gt;<br>
</blockquote></div></div></div>
Mathieu Malaterre Jan. 2, 2019, 8:03 p.m. UTC | #3
Bartlomiej,

Do you need an Acked-by from Rob, or can you take it in the next round
of fixes for v4.20 ?

Just to repeat myself, previous code would call
offb_init_palette_hacks(), which in turn would do:

       if (dp && !strncmp(name, "ATY,Rage128", 11)) {

with name=NULL.

Thanks

On Thu, Dec 20, 2018 at 5:10 PM Mathieu Malaterre <malat@debian.org> wrote:
>
> Rob, any comment ?
>
> On Fri, Dec 7, 2018 at 1:59 PM Mathieu Malaterre <malat@debian.org> wrote:
> >
> > This is a partial revert of commit 5c63e407aaab ("fbdev: Convert to
> > using %pOFn instead of device_node.name"). This is the minimal work to
> > get a Mac Mini G4 back to a bootable state. The function
> > offb_init_palette_hacks would need to handle the case where `name` has
> > been set to NULL.
> >
> > Cc: Rob Herring <robh@kernel.org>
> > Fixes: 5c63e407aaab ("fbdev: Convert to using %pOFn instead of device_node.name")
> > Cc: stable@vger.kernel.org # v4.19+
> > Signed-off-by: Mathieu Malaterre <malat@debian.org>
> > ---
> >  drivers/video/fbdev/offb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
> > index 31f769d67195..6e75851f8142 100644
> > --- a/drivers/video/fbdev/offb.c
> > +++ b/drivers/video/fbdev/offb.c
> > @@ -648,7 +648,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
> >                 /* kludge for valkyrie */
> >                 if (strcmp(dp->name, "valkyrie") == 0)
> >                         address += 0x1000;
> > -               offb_init_fb(no_real_node ? "bootx" : NULL,
> > +               offb_init_fb(no_real_node ? "bootx" : dp->name,
> >                              width, height, depth, pitch, address,
> >                              foreign_endian, no_real_node ? NULL : dp);
> >         }
> > --
> > 2.19.2
> >
Rob Herring (Arm) Jan. 7, 2019, 5:31 p.m. UTC | #4
On Wed, Jan 2, 2019 at 2:03 PM Mathieu Malaterre <malat@debian.org> wrote:
>
> Bartlomiej,
>
> Do you need an Acked-by from Rob, or can you take it in the next round
> of fixes for v4.20 ?

Sorry, I missed this.

>
> Just to repeat myself, previous code would call
> offb_init_palette_hacks(), which in turn would do:
>
>        if (dp && !strncmp(name, "ATY,Rage128", 11)) {
>
> with name=NULL.

I prefer to fix this properly using node name helper in
offb_init_palette_hacks(). I'll send a patch shortly.


Rob
diff mbox series

Patch

diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
index 31f769d67195..6e75851f8142 100644
--- a/drivers/video/fbdev/offb.c
+++ b/drivers/video/fbdev/offb.c
@@ -648,7 +648,7 @@  static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
 		/* kludge for valkyrie */
 		if (strcmp(dp->name, "valkyrie") == 0)
 			address += 0x1000;
-		offb_init_fb(no_real_node ? "bootx" : NULL,
+		offb_init_fb(no_real_node ? "bootx" : dp->name,
 			     width, height, depth, pitch, address,
 			     foreign_endian, no_real_node ? NULL : dp);
 	}