generic: fix build warning
Fixes a unused variable warning: drivers/of/of_net.c: In function 'of_get_mac_address_mtd': drivers/of/of_net.c:92:19: warning: unused variable 'prop' [-Wunused-variable] Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
		@@ -34,7 +34,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
 | 
				
			|||||||
 {
 | 
					 {
 | 
				
			||||||
 	struct property *pp = of_find_property(np, name, NULL);
 | 
					 	struct property *pp = of_find_property(np, name, NULL);
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
@@ -78,6 +79,56 @@ static const void *of_get_mac_addr_nvmem
 | 
					@@ -78,6 +79,55 @@ static const void *of_get_mac_addr_nvmem
 | 
				
			||||||
 	return mac;
 | 
					 	return mac;
 | 
				
			||||||
 }
 | 
					 }
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
@@ -43,7 +43,6 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
 | 
				
			|||||||
+#ifdef CONFIG_MTD
 | 
					+#ifdef CONFIG_MTD
 | 
				
			||||||
+	struct platform_device *pdev = of_find_device_by_node(np);
 | 
					+	struct platform_device *pdev = of_find_device_by_node(np);
 | 
				
			||||||
+	struct device_node *mtd_np = NULL;
 | 
					+	struct device_node *mtd_np = NULL;
 | 
				
			||||||
+	struct property *prop;
 | 
					 | 
				
			||||||
+	size_t retlen;
 | 
					+	size_t retlen;
 | 
				
			||||||
+	int size, ret;
 | 
					+	int size, ret;
 | 
				
			||||||
+	struct mtd_info *mtd;
 | 
					+	struct mtd_info *mtd;
 | 
				
			||||||
@@ -91,7 +90,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
 | 
				
			|||||||
 /**
 | 
					 /**
 | 
				
			||||||
  * Search the device tree for the best MAC address to use.  'mac-address' is
 | 
					  * Search the device tree for the best MAC address to use.  'mac-address' is
 | 
				
			||||||
  * checked first, because that is supposed to contain to "most recent" MAC
 | 
					  * checked first, because that is supposed to contain to "most recent" MAC
 | 
				
			||||||
@@ -98,6 +149,10 @@ static const void *of_get_mac_addr_nvmem
 | 
					@@ -98,6 +148,10 @@ static const void *of_get_mac_addr_nvmem
 | 
				
			||||||
  * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
 | 
					  * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
 | 
				
			||||||
  * but is all zeros.
 | 
					  * but is all zeros.
 | 
				
			||||||
  *
 | 
					  *
 | 
				
			||||||
@@ -102,7 +101,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
 | 
				
			|||||||
  * Return: Will be a valid pointer on success and ERR_PTR in case of error.
 | 
					  * Return: Will be a valid pointer on success and ERR_PTR in case of error.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 const void *of_get_mac_address(struct device_node *np)
 | 
					 const void *of_get_mac_address(struct device_node *np)
 | 
				
			||||||
@@ -116,6 +171,10 @@ const void *of_get_mac_address(struct de
 | 
					@@ -116,6 +170,10 @@ const void *of_get_mac_address(struct de
 | 
				
			||||||
 	if (addr)
 | 
					 	if (addr)
 | 
				
			||||||
 		return addr;
 | 
					 		return addr;
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -65,7 +65,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
 | 
				
			|||||||
 {
 | 
					 {
 | 
				
			||||||
 #ifdef CONFIG_MTD
 | 
					 #ifdef CONFIG_MTD
 | 
				
			||||||
 	struct platform_device *pdev = of_find_device_by_node(np);
 | 
					 	struct platform_device *pdev = of_find_device_by_node(np);
 | 
				
			||||||
@@ -153,28 +158,54 @@ static const void *of_get_mac_address_mt
 | 
					@@ -152,28 +157,54 @@ static const void *of_get_mac_address_mt
 | 
				
			||||||
  * If a mtd-mac-address property exists, try to fetch the MAC address from the
 | 
					  * If a mtd-mac-address property exists, try to fetch the MAC address from the
 | 
				
			||||||
  * specified mtd device.
 | 
					  * specified mtd device.
 | 
				
			||||||
  *
 | 
					  *
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
--- a/drivers/of/of_net.c
 | 
					--- a/drivers/of/of_net.c
 | 
				
			||||||
+++ b/drivers/of/of_net.c
 | 
					+++ b/drivers/of/of_net.c
 | 
				
			||||||
@@ -133,6 +133,33 @@ static void *of_get_mac_address_mtd(stru
 | 
					@@ -132,6 +132,33 @@ static void *of_get_mac_address_mtd(stru
 | 
				
			||||||
 	return NULL;
 | 
					 	return NULL;
 | 
				
			||||||
 }
 | 
					 }
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
@@ -34,7 +34,7 @@
 | 
				
			|||||||
 
 | 
					 
 | 
				
			||||||
 /**
 | 
					 /**
 | 
				
			||||||
  * Search the device tree for the best MAC address to use.  'mac-address' is
 | 
					  * Search the device tree for the best MAC address to use.  'mac-address' is
 | 
				
			||||||
@@ -206,6 +233,7 @@ found:
 | 
					@@ -205,6 +232,7 @@ found:
 | 
				
			||||||
 	if (!of_property_read_u32(np, "mac-address-increment", &mac_inc))
 | 
					 	if (!of_property_read_u32(np, "mac-address-increment", &mac_inc))
 | 
				
			||||||
 		addr[inc_idx] += mac_inc;
 | 
					 		addr[inc_idx] += mac_inc;
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,7 +34,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
 | 
				
			|||||||
 {
 | 
					 {
 | 
				
			||||||
 	struct property *pp = of_find_property(np, name, NULL);
 | 
					 	struct property *pp = of_find_property(np, name, NULL);
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
@@ -72,6 +73,56 @@ static const void *of_get_mac_addr_nvmem
 | 
					@@ -72,6 +73,55 @@ static const void *of_get_mac_addr_nvmem
 | 
				
			||||||
 	return mac;
 | 
					 	return mac;
 | 
				
			||||||
 }
 | 
					 }
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
@@ -43,7 +43,6 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
 | 
				
			|||||||
+#ifdef CONFIG_MTD
 | 
					+#ifdef CONFIG_MTD
 | 
				
			||||||
+	struct platform_device *pdev = of_find_device_by_node(np);
 | 
					+	struct platform_device *pdev = of_find_device_by_node(np);
 | 
				
			||||||
+	struct device_node *mtd_np = NULL;
 | 
					+	struct device_node *mtd_np = NULL;
 | 
				
			||||||
+	struct property *prop;
 | 
					 | 
				
			||||||
+	size_t retlen;
 | 
					+	size_t retlen;
 | 
				
			||||||
+	int size, ret;
 | 
					+	int size, ret;
 | 
				
			||||||
+	struct mtd_info *mtd;
 | 
					+	struct mtd_info *mtd;
 | 
				
			||||||
@@ -91,7 +90,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
 | 
				
			|||||||
 /**
 | 
					 /**
 | 
				
			||||||
  * Search the device tree for the best MAC address to use.  'mac-address' is
 | 
					  * Search the device tree for the best MAC address to use.  'mac-address' is
 | 
				
			||||||
  * checked first, because that is supposed to contain to "most recent" MAC
 | 
					  * checked first, because that is supposed to contain to "most recent" MAC
 | 
				
			||||||
@@ -92,6 +143,10 @@ static const void *of_get_mac_addr_nvmem
 | 
					@@ -92,6 +142,10 @@ static const void *of_get_mac_addr_nvmem
 | 
				
			||||||
  * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
 | 
					  * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
 | 
				
			||||||
  * but is all zeros.
 | 
					  * but is all zeros.
 | 
				
			||||||
  *
 | 
					  *
 | 
				
			||||||
@@ -102,7 +101,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
 | 
				
			|||||||
  * Return: Will be a valid pointer on success and ERR_PTR in case of error.
 | 
					  * Return: Will be a valid pointer on success and ERR_PTR in case of error.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 const void *of_get_mac_address(struct device_node *np)
 | 
					 const void *of_get_mac_address(struct device_node *np)
 | 
				
			||||||
@@ -110,6 +165,10 @@ const void *of_get_mac_address(struct de
 | 
					@@ -110,6 +164,10 @@ const void *of_get_mac_address(struct de
 | 
				
			||||||
 	if (addr)
 | 
					 	if (addr)
 | 
				
			||||||
 		return addr;
 | 
					 		return addr;
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -65,7 +65,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
 | 
				
			|||||||
 {
 | 
					 {
 | 
				
			||||||
 #ifdef CONFIG_MTD
 | 
					 #ifdef CONFIG_MTD
 | 
				
			||||||
 	struct platform_device *pdev = of_find_device_by_node(np);
 | 
					 	struct platform_device *pdev = of_find_device_by_node(np);
 | 
				
			||||||
@@ -147,28 +152,54 @@ static const void *of_get_mac_address_mt
 | 
					@@ -146,28 +151,54 @@ static const void *of_get_mac_address_mt
 | 
				
			||||||
  * If a mtd-mac-address property exists, try to fetch the MAC address from the
 | 
					  * If a mtd-mac-address property exists, try to fetch the MAC address from the
 | 
				
			||||||
  * specified mtd device.
 | 
					  * specified mtd device.
 | 
				
			||||||
  *
 | 
					  *
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
--- a/drivers/of/of_net.c
 | 
					--- a/drivers/of/of_net.c
 | 
				
			||||||
+++ b/drivers/of/of_net.c
 | 
					+++ b/drivers/of/of_net.c
 | 
				
			||||||
@@ -127,6 +127,33 @@ static void *of_get_mac_address_mtd(stru
 | 
					@@ -126,6 +126,33 @@ static void *of_get_mac_address_mtd(stru
 | 
				
			||||||
 	return NULL;
 | 
					 	return NULL;
 | 
				
			||||||
 }
 | 
					 }
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
@@ -34,7 +34,7 @@
 | 
				
			|||||||
 
 | 
					 
 | 
				
			||||||
 /**
 | 
					 /**
 | 
				
			||||||
  * Search the device tree for the best MAC address to use.  'mac-address' is
 | 
					  * Search the device tree for the best MAC address to use.  'mac-address' is
 | 
				
			||||||
@@ -200,6 +227,7 @@ found:
 | 
					@@ -199,6 +226,7 @@ found:
 | 
				
			||||||
 	if (!of_property_read_u32(np, "mac-address-increment", &mac_inc))
 | 
					 	if (!of_property_read_u32(np, "mac-address-increment", &mac_inc))
 | 
				
			||||||
 		addr[inc_idx] += mac_inc;
 | 
					 		addr[inc_idx] += mac_inc;
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user