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

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

[POWERPC] pseries: 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.

pseries platform changes.

Built for pseries_defconfig

Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent a7f67bdf
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -691,11 +691,11 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
{
	struct eeh_early_enable_info *info = data;
	int ret;
	char *status = get_property(dn, "status", NULL);
	u32 *class_code = (u32 *)get_property(dn, "class-code", NULL);
	u32 *vendor_id = (u32 *)get_property(dn, "vendor-id", NULL);
	u32 *device_id = (u32 *)get_property(dn, "device-id", NULL);
	u32 *regs;
	const char *status = get_property(dn, "status", NULL);
	const u32 *class_code = get_property(dn, "class-code", NULL);
	const u32 *vendor_id = get_property(dn, "vendor-id", NULL);
	const u32 *device_id = get_property(dn, "device-id", NULL);
	const u32 *regs;
	int enable;
	struct pci_dn *pdn = PCI_DN(dn);

@@ -737,7 +737,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data)

	/* Ok... see if this device supports EEH.  Some do, some don't,
	 * and the only way to find out is to check each and every one. */
	regs = (u32 *)get_property(dn, "reg", NULL);
	regs = get_property(dn, "reg", NULL);
	if (regs) {
		/* First register entry is addr (00BBSS00)  */
		/* Try to enable eeh */
+2 −2
Original line number Diff line number Diff line
@@ -268,14 +268,14 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)

	if (!frozen_dn) {

		location = (char *) get_property(event->dn, "ibm,loc-code", NULL);
		location = get_property(event->dn, "ibm,loc-code", NULL);
		location = location ? location : "unknown";
		printk(KERN_ERR "EEH: Error: Cannot find partition endpoint "
		                "for location=%s pci addr=%s\n",
		        location, pci_name(event->dev));
		return NULL;
	}
	location = (char *) get_property(frozen_dn, "ibm,loc-code", NULL);
	location = get_property(frozen_dn, "ibm,loc-code", NULL);
	location = location ? location : "unknown";

	/* There are two different styles for coming up with the PE.
+2 −2
Original line number Diff line number Diff line
@@ -124,11 +124,11 @@ int eeh_send_failure_event (struct device_node *dn,
{
	unsigned long flags;
	struct eeh_event *event;
	char *location;
	const char *location;

	if (!mem_init_done) {
		printk(KERN_ERR "EEH: event during early boot not handled\n");
		location = (char *) get_property(dn, "ibm,loc-code", NULL);
		location = get_property(dn, "ibm,loc-code", NULL);
		printk(KERN_ERR "EEH: device node = %s\n", dn->full_name);
		printk(KERN_ERR "EEH: PCI location = %s\n", location);
		return 1;
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = {
void __init fw_feature_init(void)
{
	struct device_node *dn;
	char *hypertas, *s;
	const char *hypertas, *s;
	int len, i;

	DBG(" -> fw_feature_init()\n");
+6 −7
Original line number Diff line number Diff line
@@ -267,13 +267,12 @@ static void iommu_table_setparms(struct pci_controller *phb,
				 struct iommu_table *tbl)
{
	struct device_node *node;
	unsigned long *basep;
	unsigned int *sizep;
	const unsigned long *basep, *sizep;

	node = (struct device_node *)phb->arch_data;

	basep = (unsigned long *)get_property(node, "linux,tce-base", NULL);
	sizep = (unsigned int *)get_property(node, "linux,tce-size", NULL);
	basep = get_property(node, "linux,tce-base", NULL);
	sizep = get_property(node, "linux,tce-size", NULL);
	if (basep == NULL || sizep == NULL) {
		printk(KERN_ERR "PCI_DMA: iommu_table_setparms: %s has "
				"missing tce entries !\n", dn->full_name);
@@ -315,7 +314,7 @@ static void iommu_table_setparms(struct pci_controller *phb,
static void iommu_table_setparms_lpar(struct pci_controller *phb,
				      struct device_node *dn,
				      struct iommu_table *tbl,
				      unsigned char *dma_window)
				      const void *dma_window)
{
	unsigned long offset, size;

@@ -415,7 +414,7 @@ static void iommu_bus_setup_pSeriesLP(struct pci_bus *bus)
	struct iommu_table *tbl;
	struct device_node *dn, *pdn;
	struct pci_dn *ppci;
	unsigned char *dma_window = NULL;
	const void *dma_window = NULL;

	DBG("iommu_bus_setup_pSeriesLP, bus %p, bus->self %p\n", bus, bus->self);

@@ -519,7 +518,7 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
{
	struct device_node *pdn, *dn;
	struct iommu_table *tbl;
	unsigned char *dma_window = NULL;
	const void *dma_window = NULL;
	struct pci_dn *pci;

	DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, pci_name(dev));
Loading