File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,23 +145,18 @@ pub(crate) struct FaultInfo {
145145/// Device resources for this GPU instance.
146146pub ( crate ) struct Resources {
147147 dev : ARef < platform:: Device > ,
148- asc : Devres < IoMem < ASC_CTL_SIZE > > ,
149- sgx : Devres < IoMem < SGX_SIZE > > ,
148+ sgx : Pin < KBox < Devres < IoMem < SGX_SIZE > > > > ,
150149}
151150
152151impl Resources {
153152 /// Map the required resources given our platform device.
154153 pub ( crate ) fn new ( pdev : & platform:: Device < Core > ) -> Result < Resources > {
155- let asc_res = pdev. resource_by_name ( c_str ! ( "asc" ) ) . ok_or ( EINVAL ) ?;
156- let asc_iomem = pdev. iomap_resource_sized :: < ASC_CTL_SIZE > ( asc_res) ?;
157-
158- let sgx_res = pdev. resource_by_name ( c_str ! ( "sgx" ) ) . ok_or ( EINVAL ) ?;
159- let sgx_iomem = pdev. iomap_resource_sized :: < SGX_SIZE > ( sgx_res) ?;
154+ let sgx_req = pdev. io_request_by_name ( c_str ! ( "sgx" ) ) . ok_or ( EINVAL ) ?;
155+ let sgx_iomem = KBox :: pin_init ( sgx_req. iomap_sized :: < SGX_SIZE > ( ) , GFP_KERNEL ) ?;
160156
161157 Ok ( Resources {
162158 // SAFETY: This device does DMA via the UAT IOMMU.
163159 dev : pdev. into ( ) ,
164- asc : asc_iomem,
165160 sgx : sgx_iomem,
166161 } )
167162 }
You can’t perform that action at this time.
0 commit comments