Re: [PATCH 1/5] MIPS: pci-ar724x: convert into a platform driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2013.02.02. 15:17 keltezéssel, John Crispin írta:
> On 02/02/13 13:40, Gabor Juhos wrote:
>> +static int ar724x_pci_probe(struct platform_device *pdev)
>> +{
>> +    struct resource *res;
>> +    int irq;
>> +
>> +    res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl_base");
>> +    if (!res)
>> +        return -EINVAL;
>> +
>> +    ar724x_pci_ctrl_base = devm_request_and_ioremap(&pdev->dev, res);
>> +    if (ar724x_pci_ctrl_base == NULL)
>> +        return -EBUSY;
>> +
>> +    res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg_base");
>> +    if (!res)
>> +        return -EINVAL;
> 
> 
> Hi,
> 
> maybe better use platform_get_resource(pdev, IORESOURCE_MEM, 0/1) ... you will
> otherwise have to patch this again when you convert to OF

I will not have to convert that. The node can have a reg-names property like this:

> 	pci0: pcie@180f0000 {
> 		#address-cells = <3>;
> 		#size-cells = <2>;
> 		#interrupt-cells = <1>;
> 		device_type = "pci";
> 		interrupt-controller;
> 		compatible = "qca,qca9558-pcie", "qca,ar7240-pcie";
> 		bus-range = <0 255>;
> 		ranges = <0x02000000 0 0x00000000 0x10000000 0 0x02000000   /* pci memory */
> 				0x01000000 0 0x00000000 0x00000000 0 0x00000001>; /* io space */
> 		reg = <0x180f0000 0x0100	/* controller base */
> 			0x14000000 0x1000	/* config space */
> 			0x180c0000 0x1000>;	/* CRP base */
> 		reg-names = "ctrl_base", "cfg_base", "crp_base";
> 
> 		interrupt-map-mask = <0xf800 0 0 7>;
> 		interrupt-map = <0 0 0 1 &pci0 0
> 					0 0 0 2 &pci0 0
> 					0 0 0 3 &pci0 0
> 					0 0 0 4 &pci0 0>;
> 
> 		interrupt-parent = <&EINTC>;
> 		interrupts = <0>;
> 	};



-Gabor


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux