Skip to content

Commit 3756597

Browse files
committed
parisc: firmware: Simplify calling non-PA20 functions
Instead of usig #ifdefs, simply return PDC_BAD_PROC for functions which aren't available on 64-bit CPUs. Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 4695e45 commit 3756597

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

arch/parisc/include/asm/pdc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@ int pdc_model_capabilities(unsigned long *capabilities);
4444
int pdc_model_platform_info(char *orig_prod_num, char *current_prod_num, char *serial_no);
4545
int pdc_cache_info(struct pdc_cache_info *cache);
4646
int pdc_spaceid_bits(unsigned long *space_bits);
47-
#ifndef CONFIG_PA20
4847
int pdc_btlb_info(struct pdc_btlb_info *btlb);
4948
int pdc_btlb_insert(unsigned long long vpage, unsigned long physpage, unsigned long len,
5049
unsigned long entry_info, unsigned long slot);
5150
int pdc_btlb_purge_all(void);
5251
int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path);
53-
#endif /* !CONFIG_PA20 */
5452
int pdc_pim_toc11(struct pdc_toc_pim_11 *ret);
5553
int pdc_pim_toc20(struct pdc_toc_pim_20 *ret);
5654
int pdc_lan_station_id(char *lan_addr, unsigned long net_hpa);

arch/parisc/kernel/firmware.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,6 @@ int pdc_spaceid_bits(unsigned long *space_bits)
687687
return retval;
688688
}
689689

690-
#ifndef CONFIG_PA20
691690
/**
692691
* pdc_btlb_info - Return block TLB information.
693692
* @btlb: The return buffer.
@@ -699,6 +698,9 @@ int pdc_btlb_info(struct pdc_btlb_info *btlb)
699698
int retval;
700699
unsigned long flags;
701700

701+
if (IS_ENABLED(CONFIG_PA20))
702+
return PDC_BAD_PROC;
703+
702704
spin_lock_irqsave(&pdc_lock, flags);
703705
retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(pdc_result), 0);
704706
memcpy(btlb, pdc_result, sizeof(*btlb));
@@ -716,6 +718,9 @@ int pdc_btlb_insert(unsigned long long vpage, unsigned long physpage, unsigned l
716718
int retval;
717719
unsigned long flags;
718720

721+
if (IS_ENABLED(CONFIG_PA20))
722+
return PDC_BAD_PROC;
723+
719724
spin_lock_irqsave(&pdc_lock, flags);
720725
retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INSERT, (unsigned long) (vpage >> 32),
721726
(unsigned long) vpage, physpage, len, entry_info, slot);
@@ -728,6 +733,9 @@ int pdc_btlb_purge_all(void)
728733
int retval;
729734
unsigned long flags;
730735

736+
if (IS_ENABLED(CONFIG_PA20))
737+
return PDC_BAD_PROC;
738+
731739
spin_lock_irqsave(&pdc_lock, flags);
732740
retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_PURGE_ALL);
733741
spin_unlock_irqrestore(&pdc_lock, flags);
@@ -752,6 +760,9 @@ int pdc_mem_map_hpa(struct pdc_memory_map *address,
752760
int retval;
753761
unsigned long flags;
754762

763+
if (IS_ENABLED(CONFIG_PA20))
764+
return PDC_BAD_PROC;
765+
755766
spin_lock_irqsave(&pdc_lock, flags);
756767
memcpy(pdc_result2, mod_path, sizeof(*mod_path));
757768
retval = mem_pdc_call(PDC_MEM_MAP, PDC_MEM_MAP_HPA, __pa(pdc_result),
@@ -761,7 +772,6 @@ int pdc_mem_map_hpa(struct pdc_memory_map *address,
761772

762773
return retval;
763774
}
764-
#endif /* !CONFIG_PA20 */
765775

766776
/**
767777
* pdc_lan_station_id - Get the LAN address.

0 commit comments

Comments
 (0)