提交 294ef16a 编写于 作者: J Jeremy Kerr 提交者: Paul Mackerras

[POWERPC] scsi: 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 scsi driver changes.
Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 b04e3dd4
...@@ -156,8 +156,8 @@ static void gather_partition_info(void) ...@@ -156,8 +156,8 @@ static void gather_partition_info(void)
{ {
struct device_node *rootdn; struct device_node *rootdn;
char *ppartition_name; const char *ppartition_name;
unsigned int *p_number_ptr; const unsigned int *p_number_ptr;
/* Retrieve information about this partition */ /* Retrieve information about this partition */
rootdn = find_path_device("/"); rootdn = find_path_device("/");
...@@ -165,14 +165,11 @@ static void gather_partition_info(void) ...@@ -165,14 +165,11 @@ static void gather_partition_info(void)
return; return;
} }
ppartition_name = ppartition_name = get_property(rootdn, "ibm,partition-name", NULL);
get_property(rootdn, "ibm,partition-name", NULL);
if (ppartition_name) if (ppartition_name)
strncpy(partition_name, ppartition_name, strncpy(partition_name, ppartition_name,
sizeof(partition_name)); sizeof(partition_name));
p_number_ptr = p_number_ptr = get_property(rootdn, "ibm,partition-no", NULL);
(unsigned int *)get_property(rootdn, "ibm,partition-no",
NULL);
if (p_number_ptr) if (p_number_ptr)
partition_number = *p_number_ptr; partition_number = *p_number_ptr;
} }
......
...@@ -431,7 +431,7 @@ static int mac53c94_probe(struct macio_dev *mdev, const struct of_device_id *mat ...@@ -431,7 +431,7 @@ static int mac53c94_probe(struct macio_dev *mdev, const struct of_device_id *mat
struct fsc_state *state; struct fsc_state *state;
struct Scsi_Host *host; struct Scsi_Host *host;
void *dma_cmd_space; void *dma_cmd_space;
unsigned char *clkprop; const unsigned char *clkprop;
int proplen, rc = -ENODEV; int proplen, rc = -ENODEV;
if (macio_resource_count(mdev) != 2 || macio_irq_count(mdev) != 2) { if (macio_resource_count(mdev) != 2 || macio_irq_count(mdev) != 2) {
......
...@@ -1850,7 +1850,8 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match) ...@@ -1850,7 +1850,8 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
{ {
struct device_node *mesh = macio_get_of_node(mdev); struct device_node *mesh = macio_get_of_node(mdev);
struct pci_dev* pdev = macio_get_pci_dev(mdev); struct pci_dev* pdev = macio_get_pci_dev(mdev);
int tgt, *cfp, minper; int tgt, minper;
const int *cfp;
struct mesh_state *ms; struct mesh_state *ms;
struct Scsi_Host *mesh_host; struct Scsi_Host *mesh_host;
void *dma_cmd_space; void *dma_cmd_space;
...@@ -1939,7 +1940,7 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match) ...@@ -1939,7 +1940,7 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
ms->tgts[tgt].current_req = NULL; ms->tgts[tgt].current_req = NULL;
} }
if ((cfp = (int *) get_property(mesh, "clock-frequency", NULL))) if ((cfp = get_property(mesh, "clock-frequency", NULL)))
ms->clk_freq = *cfp; ms->clk_freq = *cfp;
else { else {
printk(KERN_INFO "mesh: assuming 50MHz clock frequency\n"); printk(KERN_INFO "mesh: assuming 50MHz clock frequency\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册