Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b04e3dd4 authored by Jeremy Kerr's avatar Jeremy Kerr Committed by Paul Mackerras
Browse files

[POWERPC] video & agp: Constify & voidify get_property()



Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.

powerpc-specific video & agp driver changes.

Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 018a3d1d
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -601,8 +601,8 @@ static int __devinit agp_uninorth_probe(struct pci_dev *pdev,
		uninorth_node = of_find_node_by_name(NULL, "u3");
		uninorth_node = of_find_node_by_name(NULL, "u3");
	}
	}
	if (uninorth_node) {
	if (uninorth_node) {
		int *revprop = (int *)
		const int *revprop = get_property(uninorth_node,
			get_property(uninorth_node, "device-rev", NULL);
				"device-rev", NULL);
		if (revprop != NULL)
		if (revprop != NULL)
			uninorth_rev = *revprop & 0x3f;
			uninorth_rev = *revprop & 0x3f;
		of_node_put(uninorth_node);
		of_node_put(uninorth_node);
+6 −6
Original line number Original line Diff line number Diff line
@@ -350,30 +350,30 @@ static void __init s3triofb_of_init(struct device_node *dp)
    s3trio_name[sizeof(s3trio_name)-1] = '\0';
    s3trio_name[sizeof(s3trio_name)-1] = '\0';
    strcpy(fb_fix.id, s3trio_name);
    strcpy(fb_fix.id, s3trio_name);


    if((pp = (int *)get_property(dp, "vendor-id", &len)) != NULL
    if((pp = get_property(dp, "vendor-id", &len)) != NULL
	&& *pp!=PCI_VENDOR_ID_S3) {
	&& *pp!=PCI_VENDOR_ID_S3) {
	printk("%s: can't find S3 Trio board\n", dp->full_name);
	printk("%s: can't find S3 Trio board\n", dp->full_name);
	return;
	return;
    }
    }


    if((pp = (int *)get_property(dp, "device-id", &len)) != NULL
    if((pp = get_property(dp, "device-id", &len)) != NULL
	&& *pp!=PCI_DEVICE_ID_S3_TRIO) {
	&& *pp!=PCI_DEVICE_ID_S3_TRIO) {
	printk("%s: can't find S3 Trio board\n", dp->full_name);
	printk("%s: can't find S3 Trio board\n", dp->full_name);
	return;
	return;
    }
    }


    if ((pp = (int *)get_property(dp, "depth", &len)) != NULL
    if ((pp = get_property(dp, "depth", &len)) != NULL
	&& len == sizeof(int) && *pp != 8) {
	&& len == sizeof(int) && *pp != 8) {
	printk("%s: can't use depth = %d\n", dp->full_name, *pp);
	printk("%s: can't use depth = %d\n", dp->full_name, *pp);
	return;
	return;
    }
    }
    if ((pp = (int *)get_property(dp, "width", &len)) != NULL
    if ((pp = get_property(dp, "width", &len)) != NULL
	&& len == sizeof(int))
	&& len == sizeof(int))
	fb_var.xres = fb_var.xres_virtual = *pp;
	fb_var.xres = fb_var.xres_virtual = *pp;
    if ((pp = (int *)get_property(dp, "height", &len)) != NULL
    if ((pp = get_property(dp, "height", &len)) != NULL
	&& len == sizeof(int))
	&& len == sizeof(int))
	fb_var.yres = fb_var.yres_virtual = *pp;
	fb_var.yres = fb_var.yres_virtual = *pp;
    if ((pp = (int *)get_property(dp, "linebytes", &len)) != NULL
    if ((pp = get_property(dp, "linebytes", &len)) != NULL
	&& len == sizeof(int))
	&& len == sizeof(int))
	fb_fix.line_length = *pp;
	fb_fix.line_length = *pp;
    else
    else
+4 −4
Original line number Original line Diff line number Diff line
@@ -412,11 +412,11 @@ static int __devinit radeon_find_mem_vbios(struct radeonfb_info *rinfo)
static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
{
{
	struct device_node *dp = rinfo->of_node;
	struct device_node *dp = rinfo->of_node;
	u32 *val;
	const u32 *val;


	if (dp == NULL)
	if (dp == NULL)
		return -ENODEV;
		return -ENODEV;
	val = (u32 *) get_property(dp, "ATY,RefCLK", NULL);
	val = get_property(dp, "ATY,RefCLK", NULL);
	if (!val || !*val) {
	if (!val || !*val) {
		printk(KERN_WARNING "radeonfb: No ATY,RefCLK property !\n");
		printk(KERN_WARNING "radeonfb: No ATY,RefCLK property !\n");
		return -EINVAL;
		return -EINVAL;
@@ -424,11 +424,11 @@ static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)


	rinfo->pll.ref_clk = (*val) / 10;
	rinfo->pll.ref_clk = (*val) / 10;


	val = (u32 *) get_property(dp, "ATY,SCLK", NULL);
	val = get_property(dp, "ATY,SCLK", NULL);
	if (val && *val)
	if (val && *val)
		rinfo->pll.sclk = (*val) / 10;
		rinfo->pll.sclk = (*val) / 10;


	val = (u32 *) get_property(dp, "ATY,MCLK", NULL);
	val = get_property(dp, "ATY,MCLK", NULL);
	if (val && *val)
	if (val && *val)
		rinfo->pll.mclk = (*val) / 10;
		rinfo->pll.mclk = (*val) / 10;


+6 −6
Original line number Original line Diff line number Diff line
@@ -64,13 +64,13 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_
{
{
        static char *propnames[] = { "DFP,EDID", "LCD,EDID", "EDID",
        static char *propnames[] = { "DFP,EDID", "LCD,EDID", "EDID",
				     "EDID1", "EDID2",  NULL };
				     "EDID1", "EDID2",  NULL };
	u8 *pedid = NULL;
	const u8 *pedid = NULL;
	u8 *pmt = NULL;
	const u8 *pmt = NULL;
	u8 *tmp;
	u8 *tmp;
        int i, mt = MT_NONE;  
        int i, mt = MT_NONE;  
	
	
	RTRACE("analyzing OF properties...\n");
	RTRACE("analyzing OF properties...\n");
	pmt = (u8 *)get_property(dp, "display-type", NULL);
	pmt = get_property(dp, "display-type", NULL);
	if (!pmt)
	if (!pmt)
		return MT_NONE;
		return MT_NONE;
	RTRACE("display-type: %s\n", pmt);
	RTRACE("display-type: %s\n", pmt);
@@ -89,7 +89,7 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_
	}
	}


	for (i = 0; propnames[i] != NULL; ++i) {
	for (i = 0; propnames[i] != NULL; ++i) {
		pedid = (u8 *)get_property(dp, propnames[i], NULL);
		pedid = get_property(dp, propnames[i], NULL);
		if (pedid != NULL)
		if (pedid != NULL)
			break;
			break;
	}
	}
@@ -124,14 +124,14 @@ static int __devinit radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_
		return MT_NONE;
		return MT_NONE;


	if (rinfo->has_CRTC2) {
	if (rinfo->has_CRTC2) {
		char *pname;
		const char *pname;
		int len, second = 0;
		int len, second = 0;


		dp = dp->child;
		dp = dp->child;
		do {
		do {
			if (!dp)
			if (!dp)
				return MT_NONE;
				return MT_NONE;
			pname = (char *)get_property(dp, "name", NULL);
			pname = get_property(dp, "name", NULL);
			if (!pname)
			if (!pname)
				return MT_NONE;
				return MT_NONE;
			len = strlen(pname);
			len = strlen(pname);
+2 −2
Original line number Original line Diff line number Diff line
@@ -1167,7 +1167,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo)
			  0x21320032, 0xa1320032, 0x21320032, 0xffffffff,
			  0x21320032, 0xa1320032, 0x21320032, 0xffffffff,
			  0x31320032 };
			  0x31320032 };


		u32 *mrtable = default_mrtable;
		const u32 *mrtable = default_mrtable;
		int i, mrtable_size = ARRAY_SIZE(default_mrtable);
		int i, mrtable_size = ARRAY_SIZE(default_mrtable);


		mdelay(30);
		mdelay(30);
@@ -1186,7 +1186,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo)
		if (rinfo->of_node != NULL) {
		if (rinfo->of_node != NULL) {
			int size;
			int size;


			mrtable = (u32 *)get_property(rinfo->of_node, "ATY,MRT", &size);
			mrtable = get_property(rinfo->of_node, "ATY,MRT", &size);
			if (mrtable)
			if (mrtable)
				mrtable_size = size >> 2;
				mrtable_size = size >> 2;
			else
			else
Loading