@@ -58,7 +58,7 @@ static const char *dfl_pdata_key_strings[DFL_ID_MAX] = {
5858 */
5959struct dfl_dev_info {
6060 const char * name ;
61- u32 dfh_id ;
61+ u16 dfh_id ;
6262 struct idr id ;
6363 enum dfl_fpga_devt_type devt_type ;
6464};
@@ -134,7 +134,7 @@ static enum dfl_id_type feature_dev_id_type(struct platform_device *pdev)
134134 return DFL_ID_MAX ;
135135}
136136
137- static enum dfl_id_type dfh_id_to_type (u32 id )
137+ static enum dfl_id_type dfh_id_to_type (u16 id )
138138{
139139 int i ;
140140
@@ -454,7 +454,7 @@ struct build_feature_devs_info {
454454 * @nr_irqs: number of irqs of this sub feature.
455455 */
456456struct dfl_feature_info {
457- u64 fid ;
457+ u16 fid ;
458458 struct resource mmio_res ;
459459 void __iomem * ioaddr ;
460460 struct list_head node ;
@@ -649,7 +649,7 @@ static inline u32 feature_size(void __iomem *start)
649649 return ofst ? ofst : 4096 ;
650650}
651651
652- static u64 feature_id (void __iomem * start )
652+ static u16 feature_id (void __iomem * start )
653653{
654654 u64 v = readq (start + DFH );
655655 u16 id = FIELD_GET (DFH_ID , v );
@@ -667,7 +667,7 @@ static u64 feature_id(void __iomem *start)
667667}
668668
669669static int parse_feature_irqs (struct build_feature_devs_info * binfo ,
670- resource_size_t ofst , u64 fid ,
670+ resource_size_t ofst , u16 fid ,
671671 unsigned int * irq_base , unsigned int * nr_irqs )
672672{
673673 void __iomem * base = binfo -> ioaddr + ofst ;
@@ -713,20 +713,20 @@ static int parse_feature_irqs(struct build_feature_devs_info *binfo,
713713 return 0 ;
714714 }
715715
716- dev_dbg (binfo -> dev , "feature: 0x%llx , irq_base: %u, nr_irqs: %u\n" ,
716+ dev_dbg (binfo -> dev , "feature: 0x%x , irq_base: %u, nr_irqs: %u\n" ,
717717 fid , ibase , inr );
718718
719719 if (ibase + inr > binfo -> nr_irqs ) {
720720 dev_err (binfo -> dev ,
721- "Invalid interrupt number in feature 0x%llx \n" , fid );
721+ "Invalid interrupt number in feature 0x%x \n" , fid );
722722 return - EINVAL ;
723723 }
724724
725725 for (i = 0 ; i < inr ; i ++ ) {
726726 virq = binfo -> irq_table [ibase + i ];
727727 if (virq < 0 || virq > NR_IRQS ) {
728728 dev_err (binfo -> dev ,
729- "Invalid irq table entry for feature 0x%llx \n" ,
729+ "Invalid irq table entry for feature 0x%x \n" ,
730730 fid );
731731 return - EINVAL ;
732732 }
@@ -748,7 +748,7 @@ static int parse_feature_irqs(struct build_feature_devs_info *binfo,
748748static int
749749create_feature_instance (struct build_feature_devs_info * binfo ,
750750 struct dfl_fpga_enum_dfl * dfl , resource_size_t ofst ,
751- resource_size_t size , u64 fid )
751+ resource_size_t size , u16 fid )
752752{
753753 unsigned int irq_base , nr_irqs ;
754754 struct dfl_feature_info * finfo ;
@@ -819,9 +819,10 @@ static int parse_feature_fiu(struct build_feature_devs_info *binfo,
819819 struct dfl_fpga_enum_dfl * dfl ,
820820 resource_size_t ofst )
821821{
822- u32 id , offset ;
823- u64 v ;
824822 int ret = 0 ;
823+ u32 offset ;
824+ u16 id ;
825+ u64 v ;
825826
826827 v = readq (dfl -> ioaddr + ofst + DFH );
827828 id = FIELD_GET (DFH_ID , v );
@@ -855,8 +856,8 @@ static int parse_feature_private(struct build_feature_devs_info *binfo,
855856 resource_size_t ofst )
856857{
857858 if (!binfo -> feature_dev ) {
858- dev_err (binfo -> dev , "the private feature %llx does not belong to any AFU.\n" ,
859- ( unsigned long long ) feature_id (dfl -> ioaddr + ofst ));
859+ dev_err (binfo -> dev , "the private feature 0x%x does not belong to any AFU.\n" ,
860+ feature_id (dfl -> ioaddr + ofst ));
860861 return - EINVAL ;
861862 }
862863
@@ -1424,7 +1425,7 @@ static int do_set_irq_trigger(struct dfl_feature *feature, unsigned int idx,
14241425 return 0 ;
14251426
14261427 feature -> irq_ctx [idx ].name =
1427- kasprintf (GFP_KERNEL , "fpga-irq[%u](%s-%llx )" , idx ,
1428+ kasprintf (GFP_KERNEL , "fpga-irq[%u](%s-%x )" , idx ,
14281429 dev_name (& pdev -> dev ), feature -> id );
14291430 if (!feature -> irq_ctx [idx ].name )
14301431 return - ENOMEM ;
0 commit comments