aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/smu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh/smu.c')
-rw-r--r--drivers/macintosh/smu.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index f139a74696fe..6f358600536e 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -447,7 +447,7 @@ EXPORT_SYMBOL(smu_present);
447int __init smu_init (void) 447int __init smu_init (void)
448{ 448{
449 struct device_node *np; 449 struct device_node *np;
450 u32 *data; 450 const u32 *data;
451 451
452 np = of_find_node_by_type(NULL, "smu"); 452 np = of_find_node_by_type(NULL, "smu");
453 if (np == NULL) 453 if (np == NULL)
@@ -483,7 +483,7 @@ int __init smu_init (void)
483 printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n"); 483 printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n");
484 goto fail; 484 goto fail;
485 } 485 }
486 data = (u32 *)get_property(np, "reg", NULL); 486 data = get_property(np, "reg", NULL);
487 if (data == NULL) { 487 if (data == NULL) {
488 of_node_put(np); 488 of_node_put(np);
489 printk(KERN_ERR "SMU: Can't find doorbell GPIO address !\n"); 489 printk(KERN_ERR "SMU: Can't find doorbell GPIO address !\n");
@@ -506,7 +506,7 @@ int __init smu_init (void)
506 np = of_find_node_by_name(NULL, "smu-interrupt"); 506 np = of_find_node_by_name(NULL, "smu-interrupt");
507 if (np == NULL) 507 if (np == NULL)
508 break; 508 break;
509 data = (u32 *)get_property(np, "reg", NULL); 509 data = get_property(np, "reg", NULL);
510 if (data == NULL) { 510 if (data == NULL) {
511 of_node_put(np); 511 of_node_put(np);
512 break; 512 break;
@@ -959,11 +959,11 @@ static struct smu_sdbp_header *smu_create_sdb_partition(int id)
959/* Note: Only allowed to return error code in pointers (using ERR_PTR) 959/* Note: Only allowed to return error code in pointers (using ERR_PTR)
960 * when interruptible is 1 960 * when interruptible is 1
961 */ 961 */
962struct smu_sdbp_header *__smu_get_sdb_partition(int id, unsigned int *size, 962const struct smu_sdbp_header *__smu_get_sdb_partition(int id,
963 int interruptible) 963 unsigned int *size, int interruptible)
964{ 964{
965 char pname[32]; 965 char pname[32];
966 struct smu_sdbp_header *part; 966 const struct smu_sdbp_header *part;
967 967
968 if (!smu) 968 if (!smu)
969 return NULL; 969 return NULL;
@@ -980,8 +980,7 @@ struct smu_sdbp_header *__smu_get_sdb_partition(int id, unsigned int *size,
980 } else 980 } else
981 mutex_lock(&smu_part_access); 981 mutex_lock(&smu_part_access);
982 982
983 part = (struct smu_sdbp_header *)get_property(smu->of_node, 983 part = get_property(smu->of_node, pname, size);
984 pname, size);
985 if (part == NULL) { 984 if (part == NULL) {
986 DPRINTK("trying to extract from SMU ...\n"); 985 DPRINTK("trying to extract from SMU ...\n");
987 part = smu_create_sdb_partition(id); 986 part = smu_create_sdb_partition(id);
@@ -992,7 +991,7 @@ struct smu_sdbp_header *__smu_get_sdb_partition(int id, unsigned int *size,
992 return part; 991 return part;
993} 992}
994 993
995struct smu_sdbp_header *smu_get_sdb_partition(int id, unsigned int *size) 994const struct smu_sdbp_header *smu_get_sdb_partition(int id, unsigned int *size)
996{ 995{
997 return __smu_get_sdb_partition(id, size, 0); 996 return __smu_get_sdb_partition(id, size, 0);
998} 997}
@@ -1071,7 +1070,7 @@ static ssize_t smu_write(struct file *file, const char __user *buf,
1071 pp->mode = smu_file_events; 1070 pp->mode = smu_file_events;
1072 return 0; 1071 return 0;
1073 } else if (hdr.cmdtype == SMU_CMDTYPE_GET_PARTITION) { 1072 } else if (hdr.cmdtype == SMU_CMDTYPE_GET_PARTITION) {
1074 struct smu_sdbp_header *part; 1073 const struct smu_sdbp_header *part;
1075 part = __smu_get_sdb_partition(hdr.cmd, NULL, 1); 1074 part = __smu_get_sdb_partition(hdr.cmd, NULL, 1);
1076 if (part == NULL) 1075 if (part == NULL)
1077 return -EINVAL; 1076 return -EINVAL;