aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-07-19 01:03:58 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-20 20:15:09 -0400
commit3adf55ad5c0fcabf1c53bb274f39953cb1d6698f (patch)
tree3eab3875dc04f963ab2ec7a9be6d3d251f6201eb
parent93b3238ef8b04f1383b2aa7704487fb3c0e44193 (diff)
[SPARC]: Implement fb_is_primary_device().
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/asm-sparc/fb.h9
-rw-r--r--include/asm-sparc64/fb.h9
2 files changed, 18 insertions, 0 deletions
diff --git a/include/asm-sparc/fb.h b/include/asm-sparc/fb.h
index c7df38030992..c73ca081e1f5 100644
--- a/include/asm-sparc/fb.h
+++ b/include/asm-sparc/fb.h
@@ -1,11 +1,20 @@
1#ifndef _ASM_FB_H_ 1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_ 2#define _ASM_FB_H_
3#include <linux/fb.h> 3#include <linux/fb.h>
4#include <asm/prom.h>
4 5
5#define fb_pgprotect(...) do {} while (0) 6#define fb_pgprotect(...) do {} while (0)
6 7
7static inline int fb_is_primary_device(struct fb_info *info) 8static inline int fb_is_primary_device(struct fb_info *info)
8{ 9{
10 struct device *dev = info->device;
11 struct device_node *node;
12
13 node = dev->archdata.prom_node;
14 if (node &&
15 node == of_console_device)
16 return 1;
17
9 return 0; 18 return 0;
10} 19}
11 20
diff --git a/include/asm-sparc64/fb.h b/include/asm-sparc64/fb.h
index d6cd3a175fc3..389012e5fbad 100644
--- a/include/asm-sparc64/fb.h
+++ b/include/asm-sparc64/fb.h
@@ -3,6 +3,7 @@
3#include <linux/fb.h> 3#include <linux/fb.h>
4#include <linux/fs.h> 4#include <linux/fs.h>
5#include <asm/page.h> 5#include <asm/page.h>
6#include <asm/prom.h>
6 7
7static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, 8static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
8 unsigned long off) 9 unsigned long off)
@@ -12,6 +13,14 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
12 13
13static inline int fb_is_primary_device(struct fb_info *info) 14static inline int fb_is_primary_device(struct fb_info *info)
14{ 15{
16 struct device *dev = info->device;
17 struct device_node *node;
18
19 node = dev->archdata.prom_node;
20 if (node &&
21 node == of_console_device)
22 return 1;
23
15 return 0; 24 return 0;
16} 25}
17 26