it is used on the time many devices share a single interrupt line. Without this, kernel can't invoke the proper interrupt handler. (it vokes, but maybe not the correct one)
I made misunderstanding about the order of the invoking by kernel
the book says :
dev_id (which used to store device id) is used primarily for shared interrupt lines.
When an interrupt handler is freed, dev_id provides a unique cookie to allow the
removal of only the desired interrupt handler from the interrupt line.
Without this, it would be impossible for the kernel to know which handler to remove
on a given interrupt line.